コード例 #1
0
            public ErrorReport Deserialize(global::Omnix.Serialization.RocketPack.RocketPackReader r, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                uint propertyCount = r.GetUInt32();

                global::Omnix.Serialization.RocketPack.Timestamp p_creationTime = global::Omnix.Serialization.RocketPack.Timestamp.Zero;
                ErrorReportType p_type = (ErrorReportType)0;

                for (; propertyCount > 0; propertyCount--)
                {
                    uint id = r.GetUInt32();
                    switch (id)
                    {
                    case 0:
                    {
                        p_creationTime = r.GetTimestamp();
                        break;
                    }

                    case 1:
                    {
                        p_type = (ErrorReportType)r.GetUInt64();
                        break;
                    }
                    }
                }

                return(new ErrorReport(p_creationTime, p_type));
            }
コード例 #2
0
            public TcpProxyOptions Deserialize(global::Omnix.Serialization.RocketPack.RocketPackReader r, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                uint propertyCount = r.GetUInt32();

                TcpProxyType p_type    = (TcpProxyType)0;
                OmniAddress  p_address = OmniAddress.Empty;

                for (; propertyCount > 0; propertyCount--)
                {
                    uint id = r.GetUInt32();
                    switch (id)
                    {
                    case 0:
                    {
                        p_type = (TcpProxyType)r.GetUInt64();
                        break;
                    }

                    case 1:
                    {
                        p_address = OmniAddress.Formatter.Deserialize(r, rank + 1);
                        break;
                    }
                    }
                }

                return(new TcpProxyOptions(p_type, p_address));
            }
コード例 #3
0
            public MerkleTreeSection Deserialize(global::Omnix.Serialization.RocketPack.RocketPackReader r, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                uint propertyCount = r.GetUInt32();

                CorrectionAlgorithmType p_correctionAlgorithmType = (CorrectionAlgorithmType)0;
                ulong p_length = 0;

                OmniHash[] p_hashes = global::System.Array.Empty <OmniHash>();

                for (; propertyCount > 0; propertyCount--)
                {
                    uint id = r.GetUInt32();
                    switch (id)
                    {
                    case 0:
                    {
                        p_correctionAlgorithmType = (CorrectionAlgorithmType)r.GetUInt64();
                        break;
                    }

                    case 1:
                    {
                        p_length = r.GetUInt64();
                        break;
                    }

                    case 2:
                    {
                        var length = r.GetUInt32();
                        p_hashes = new OmniHash[length];
                        for (int i = 0; i < p_hashes.Length; i++)
                        {
                            p_hashes[i] = OmniHash.Formatter.Deserialize(r, rank + 1);
                        }
                        break;
                    }
                    }
                }

                return(new MerkleTreeSection(p_correctionAlgorithmType, p_length, p_hashes));
            }
コード例 #4
0
            public SharedBlocksMetadata Deserialize(global::Omnix.Serialization.RocketPack.RocketPackReader r, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                uint propertyCount = r.GetUInt32();

                string p_path        = string.Empty;
                ulong  p_length      = 0;
                uint   p_blockLength = 0;

                OmniHash[] p_hashes = global::System.Array.Empty <OmniHash>();

                for (; propertyCount > 0; propertyCount--)
                {
                    uint id = r.GetUInt32();
                    switch (id)
                    {
                    case 0:
                    {
                        p_path = r.GetString(1024);
                        break;
                    }

                    case 1:
                    {
                        p_length = r.GetUInt64();
                        break;
                    }

                    case 2:
                    {
                        p_blockLength = r.GetUInt32();
                        break;
                    }

                    case 3:
                    {
                        var length = r.GetUInt32();
                        p_hashes = new OmniHash[length];
                        for (int i = 0; i < p_hashes.Length; i++)
                        {
                            p_hashes[i] = OmniHash.Formatter.Deserialize(r, rank + 1);
                        }
                        break;
                    }
                    }
                }

                return(new SharedBlocksMetadata(p_path, p_length, p_blockLength, p_hashes));
            }
コード例 #5
0
            public BlockStorageConfig Deserialize(global::Omnix.Serialization.RocketPack.RocketPackReader r, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                uint propertyCount = r.GetUInt32();

                uint  p_version = 0;
                ulong p_size    = 0;

                global::System.Collections.Generic.Dictionary <OmniHash, ClusterMetadata> p_clusterMetadataMap = new global::System.Collections.Generic.Dictionary <OmniHash, ClusterMetadata>();

                for (; propertyCount > 0; propertyCount--)
                {
                    uint id = r.GetUInt32();
                    switch (id)
                    {
                    case 0:
                    {
                        p_version = r.GetUInt32();
                        break;
                    }

                    case 1:
                    {
                        p_size = r.GetUInt64();
                        break;
                    }

                    case 2:
                    {
                        var length = r.GetUInt32();
                        p_clusterMetadataMap = new global::System.Collections.Generic.Dictionary <OmniHash, ClusterMetadata>();
                        OmniHash        t_key   = OmniHash.Empty;
                        ClusterMetadata t_value = ClusterMetadata.Empty;
                        for (int i = 0; i < length; i++)
                        {
                            t_key   = OmniHash.Formatter.Deserialize(r, rank + 1);
                            t_value = ClusterMetadata.Formatter.Deserialize(r, rank + 1);
                            p_clusterMetadataMap[t_key] = t_value;
                        }
                        break;
                    }
                    }
                }

                return(new BlockStorageConfig(p_version, p_size, p_clusterMetadataMap));
            }
コード例 #6
0
            public ClusterMetadata Deserialize(global::Omnix.Serialization.RocketPack.RocketPackReader r, int rank)
            {
                if (rank > 256)
                {
                    throw new global::System.FormatException();
                }

                uint propertyCount = r.GetUInt32();

                ulong[] p_sectors = global::System.Array.Empty <ulong>();
                uint    p_length  = 0;

                global::Omnix.Serialization.RocketPack.Timestamp p_lastAccessTime = global::Omnix.Serialization.RocketPack.Timestamp.Zero;

                for (; propertyCount > 0; propertyCount--)
                {
                    uint id = r.GetUInt32();
                    switch (id)
                    {
                    case 0:
                    {
                        var length = r.GetUInt32();
                        p_sectors = new ulong[length];
                        for (int i = 0; i < p_sectors.Length; i++)
                        {
                            p_sectors[i] = r.GetUInt64();
                        }
                        break;
                    }

                    case 1:
                    {
                        p_length = r.GetUInt32();
                        break;
                    }

                    case 2:
                    {
                        p_lastAccessTime = r.GetTimestamp();
                        break;
                    }
                    }
                }

                return(new ClusterMetadata(p_sectors, p_length, p_lastAccessTime));
            }