コード例 #1
0
            public void Serialize(global::Omnix.Serialization.RocketPack.RocketPackWriter w, ConnectionCreatorOptions value, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                {
                    uint propertyCount = 0;
                    if (value.TcpConnectOptions != TcpConnectOptions.Empty)
                    {
                        propertyCount++;
                    }
                    if (value.TcpAcceptOptions != TcpAcceptOptions.Empty)
                    {
                        propertyCount++;
                    }
                    w.Write(propertyCount);
                }

                if (value.TcpConnectOptions != TcpConnectOptions.Empty)
                {
                    w.Write((uint)0);
                    TcpConnectOptions.Formatter.Serialize(w, value.TcpConnectOptions, rank + 1);
                }
                if (value.TcpAcceptOptions != TcpAcceptOptions.Empty)
                {
                    w.Write((uint)1);
                    TcpAcceptOptions.Formatter.Serialize(w, value.TcpAcceptOptions, rank + 1);
                }
            }
コード例 #2
0
            public void Serialize(global::Omnix.Serialization.RocketPack.RocketPackWriter w, ErrorReport value, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                {
                    uint propertyCount = 0;
                    if (value.CreationTime != global::Omnix.Serialization.RocketPack.Timestamp.Zero)
                    {
                        propertyCount++;
                    }
                    if (value.Type != (ErrorReportType)0)
                    {
                        propertyCount++;
                    }
                    w.Write(propertyCount);
                }

                if (value.CreationTime != global::Omnix.Serialization.RocketPack.Timestamp.Zero)
                {
                    w.Write((uint)0);
                    w.Write(value.CreationTime);
                }
                if (value.Type != (ErrorReportType)0)
                {
                    w.Write((uint)1);
                    w.Write((ulong)value.Type);
                }
            }
コード例 #3
0
            public void Serialize(global::Omnix.Serialization.RocketPack.RocketPackWriter w, XeusClue value, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                {
                    uint propertyCount = 0;
                    if (value.Hash != OmniHash.Empty)
                    {
                        propertyCount++;
                    }
                    if (value.Depth != 0)
                    {
                        propertyCount++;
                    }
                    w.Write(propertyCount);
                }

                if (value.Hash != OmniHash.Empty)
                {
                    w.Write((uint)0);
                    OmniHash.Formatter.Serialize(w, value.Hash, rank + 1);
                }
                if (value.Depth != 0)
                {
                    w.Write((uint)1);
                    w.Write(value.Depth);
                }
            }
コード例 #4
0
            public void Serialize(global::Omnix.Serialization.RocketPack.RocketPackWriter w, TcpConnectOptions value, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                {
                    uint propertyCount = 0;
                    if (value.Enabled != false)
                    {
                        propertyCount++;
                    }
                    if (value.ProxyOptions != null)
                    {
                        propertyCount++;
                    }
                    w.Write(propertyCount);
                }

                if (value.Enabled != false)
                {
                    w.Write((uint)0);
                    w.Write(value.Enabled);
                }
                if (value.ProxyOptions != null)
                {
                    w.Write((uint)1);
                    TcpProxyOptions.Formatter.Serialize(w, value.ProxyOptions, rank + 1);
                }
            }
コード例 #5
0
            public void Serialize(global::Omnix.Serialization.RocketPack.RocketPackWriter w, ContentStorageConfig value, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                {
                    uint propertyCount = 0;
                    if (value.Version != 0)
                    {
                        propertyCount++;
                    }
                    if (value.ContentMetadatas.Count != 0)
                    {
                        propertyCount++;
                    }
                    w.Write(propertyCount);
                }

                if (value.Version != 0)
                {
                    w.Write((uint)0);
                    w.Write(value.Version);
                }
                if (value.ContentMetadatas.Count != 0)
                {
                    w.Write((uint)1);
                    w.Write((uint)value.ContentMetadatas.Count);
                    foreach (var n in value.ContentMetadatas)
                    {
                        ContentMetadata.Formatter.Serialize(w, n, rank + 1);
                    }
                }
            }
コード例 #6
0
            public void Serialize(global::Omnix.Serialization.RocketPack.RocketPackWriter w, TcpProxyOptions value, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                {
                    uint propertyCount = 0;
                    if (value.Type != (TcpProxyType)0)
                    {
                        propertyCount++;
                    }
                    if (value.Address != OmniAddress.Empty)
                    {
                        propertyCount++;
                    }
                    w.Write(propertyCount);
                }

                if (value.Type != (TcpProxyType)0)
                {
                    w.Write((uint)0);
                    w.Write((ulong)value.Type);
                }
                if (value.Address != OmniAddress.Empty)
                {
                    w.Write((uint)1);
                    OmniAddress.Formatter.Serialize(w, value.Address, rank + 1);
                }
            }
コード例 #7
0
            public void Serialize(global::Omnix.Serialization.RocketPack.RocketPackWriter w, MerkleTreeNode value, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                {
                    uint propertyCount = 0;
                    if (value.Sections.Count != 0)
                    {
                        propertyCount++;
                    }
                    w.Write(propertyCount);
                }

                if (value.Sections.Count != 0)
                {
                    w.Write((uint)0);
                    w.Write((uint)value.Sections.Count);
                    foreach (var n in value.Sections)
                    {
                        MerkleTreeSection.Formatter.Serialize(w, n, rank + 1);
                    }
                }
            }
コード例 #8
0
            public void Serialize(global::Omnix.Serialization.RocketPack.RocketPackWriter w, SharedBlocksMetadata value, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                {
                    uint propertyCount = 0;
                    if (value.Path != string.Empty)
                    {
                        propertyCount++;
                    }
                    if (value.Length != 0)
                    {
                        propertyCount++;
                    }
                    if (value.BlockLength != 0)
                    {
                        propertyCount++;
                    }
                    if (value.Hashes.Count != 0)
                    {
                        propertyCount++;
                    }
                    w.Write(propertyCount);
                }

                if (value.Path != string.Empty)
                {
                    w.Write((uint)0);
                    w.Write(value.Path);
                }
                if (value.Length != 0)
                {
                    w.Write((uint)1);
                    w.Write(value.Length);
                }
                if (value.BlockLength != 0)
                {
                    w.Write((uint)2);
                    w.Write(value.BlockLength);
                }
                if (value.Hashes.Count != 0)
                {
                    w.Write((uint)3);
                    w.Write((uint)value.Hashes.Count);
                    foreach (var n in value.Hashes)
                    {
                        OmniHash.Formatter.Serialize(w, n, rank + 1);
                    }
                }
            }
コード例 #9
0
            public void Serialize(global::Omnix.Serialization.RocketPack.RocketPackWriter w, BlockStorageConfig value, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                {
                    uint propertyCount = 0;
                    if (value.Version != 0)
                    {
                        propertyCount++;
                    }
                    if (value.Size != 0)
                    {
                        propertyCount++;
                    }
                    if (value.ClusterMetadataMap.Count != 0)
                    {
                        propertyCount++;
                    }
                    w.Write(propertyCount);
                }

                if (value.Version != 0)
                {
                    w.Write((uint)0);
                    w.Write(value.Version);
                }
                if (value.Size != 0)
                {
                    w.Write((uint)1);
                    w.Write(value.Size);
                }
                if (value.ClusterMetadataMap.Count != 0)
                {
                    w.Write((uint)2);
                    w.Write((uint)value.ClusterMetadataMap.Count);
                    foreach (var n in value.ClusterMetadataMap)
                    {
                        OmniHash.Formatter.Serialize(w, n.Key, rank + 1);
                        ClusterMetadata.Formatter.Serialize(w, n.Value, rank + 1);
                    }
                }
            }
コード例 #10
0
            public void Serialize(global::Omnix.Serialization.RocketPack.RocketPackWriter w, TcpAcceptOptions value, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                {
                    uint propertyCount = 0;
                    if (value.Enabled != false)
                    {
                        propertyCount++;
                    }
                    if (value.ListenAddresses.Count != 0)
                    {
                        propertyCount++;
                    }
                    if (value.UseUpnp != false)
                    {
                        propertyCount++;
                    }
                    w.Write(propertyCount);
                }

                if (value.Enabled != false)
                {
                    w.Write((uint)0);
                    w.Write(value.Enabled);
                }
                if (value.ListenAddresses.Count != 0)
                {
                    w.Write((uint)1);
                    w.Write((uint)value.ListenAddresses.Count);
                    foreach (var n in value.ListenAddresses)
                    {
                        OmniAddress.Formatter.Serialize(w, n, rank + 1);
                    }
                }
                if (value.UseUpnp != false)
                {
                    w.Write((uint)2);
                    w.Write(value.UseUpnp);
                }
            }
コード例 #11
0
            public void Serialize(global::Omnix.Serialization.RocketPack.RocketPackWriter w, ClusterMetadata value, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                {
                    uint propertyCount = 0;
                    if (value.Sectors.Count != 0)
                    {
                        propertyCount++;
                    }
                    if (value.Length != 0)
                    {
                        propertyCount++;
                    }
                    if (value.LastAccessTime != global::Omnix.Serialization.RocketPack.Timestamp.Zero)
                    {
                        propertyCount++;
                    }
                    w.Write(propertyCount);
                }

                if (value.Sectors.Count != 0)
                {
                    w.Write((uint)0);
                    w.Write((uint)value.Sectors.Count);
                    foreach (var n in value.Sectors)
                    {
                        w.Write(n);
                    }
                }
                if (value.Length != 0)
                {
                    w.Write((uint)1);
                    w.Write(value.Length);
                }
                if (value.LastAccessTime != global::Omnix.Serialization.RocketPack.Timestamp.Zero)
                {
                    w.Write((uint)2);
                    w.Write(value.LastAccessTime);
                }
            }
コード例 #12
0
            public void Serialize(global::Omnix.Serialization.RocketPack.RocketPackWriter w, ContentMetadata value, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                {
                    uint propertyCount = 0;
                    if (value.Clue != XeusClue.Empty)
                    {
                        propertyCount++;
                    }
                    if (value.LockedHashes.Count != 0)
                    {
                        propertyCount++;
                    }
                    if (value.SharedBlocksMetadata != null)
                    {
                        propertyCount++;
                    }
                    w.Write(propertyCount);
                }

                if (value.Clue != XeusClue.Empty)
                {
                    w.Write((uint)0);
                    XeusClue.Formatter.Serialize(w, value.Clue, rank + 1);
                }
                if (value.LockedHashes.Count != 0)
                {
                    w.Write((uint)1);
                    w.Write((uint)value.LockedHashes.Count);
                    foreach (var n in value.LockedHashes)
                    {
                        OmniHash.Formatter.Serialize(w, n, rank + 1);
                    }
                }
                if (value.SharedBlocksMetadata != null)
                {
                    w.Write((uint)2);
                    SharedBlocksMetadata.Formatter.Serialize(w, value.SharedBlocksMetadata, rank + 1);
                }
            }
コード例 #13
0
            public void Serialize(global::Omnix.Serialization.RocketPack.RocketPackWriter w, MerkleTreeSection value, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                {
                    uint propertyCount = 0;
                    if (value.CorrectionAlgorithmType != (CorrectionAlgorithmType)0)
                    {
                        propertyCount++;
                    }
                    if (value.Length != 0)
                    {
                        propertyCount++;
                    }
                    if (value.Hashes.Count != 0)
                    {
                        propertyCount++;
                    }
                    w.Write(propertyCount);
                }

                if (value.CorrectionAlgorithmType != (CorrectionAlgorithmType)0)
                {
                    w.Write((uint)0);
                    w.Write((ulong)value.CorrectionAlgorithmType);
                }
                if (value.Length != 0)
                {
                    w.Write((uint)1);
                    w.Write(value.Length);
                }
                if (value.Hashes.Count != 0)
                {
                    w.Write((uint)2);
                    w.Write((uint)value.Hashes.Count);
                    foreach (var n in value.Hashes)
                    {
                        OmniHash.Formatter.Serialize(w, n, rank + 1);
                    }
                }
            }
コード例 #14
0
            public void Serialize(global::Omnix.Serialization.RocketPack.RocketPackWriter w, CheckBlocksProgressReport value, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                {
                    uint propertyCount = 0;
                    if (value.BadBlockCount != 0)
                    {
                        propertyCount++;
                    }
                    if (value.CheckedBlockCount != 0)
                    {
                        propertyCount++;
                    }
                    if (value.TotalBlockCount != 0)
                    {
                        propertyCount++;
                    }
                    w.Write(propertyCount);
                }

                if (value.BadBlockCount != 0)
                {
                    w.Write((uint)0);
                    w.Write(value.BadBlockCount);
                }
                if (value.CheckedBlockCount != 0)
                {
                    w.Write((uint)1);
                    w.Write(value.CheckedBlockCount);
                }
                if (value.TotalBlockCount != 0)
                {
                    w.Write((uint)2);
                    w.Write(value.TotalBlockCount);
                }
            }
コード例 #15
0
            public void Serialize(global::Omnix.Serialization.RocketPack.RocketPackWriter w, XeusOptions value, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                {
                    uint propertyCount = 0;
                    if (value.ConfigDirectoryPath != string.Empty)
                    {
                        propertyCount++;
                    }
                    w.Write(propertyCount);
                }

                if (value.ConfigDirectoryPath != string.Empty)
                {
                    w.Write((uint)0);
                    w.Write(value.ConfigDirectoryPath);
                }
            }