Space Engineers
|
Provides protobuf serialization support for a number of types More...
Public Member Functions | |
void | Serialize (Stream dest, object value) |
Writes a protocol-buffer representation of the given instance to the supplied stream. More... | |
void | Serialize (Stream dest, object value, SerializationContext context) |
Writes a protocol-buffer representation of the given instance to the supplied stream. More... | |
void | Serialize (ProtoWriter dest, object value) |
Writes a protocol-buffer representation of the given instance to the supplied writer. More... | |
object | DeserializeWithLengthPrefix (Stream source, object value, Type type, PrefixStyle style, int fieldNumber) |
Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed data - useful with network IO. More... | |
object | DeserializeWithLengthPrefix (Stream source, object value, Type type, PrefixStyle style, int expectedField, Serializer.TypeResolver resolver) |
Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed data - useful with network IO. More... | |
object | DeserializeWithLengthPrefix (Stream source, object value, Type type, PrefixStyle style, int expectedField, Serializer.TypeResolver resolver, out int bytesRead) |
Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed data - useful with network IO. More... | |
System.Collections.IEnumerable | DeserializeItems (System.IO.Stream source, Type type, PrefixStyle style, int expectedField, Serializer.TypeResolver resolver) |
Reads a sequence of consecutive length-prefixed items from a stream, using either base-128 or fixed-length prefixes. Base-128 prefixes with a tag are directly comparable to serializing multiple items in succession (use the Serializer.ListItemTag tag to emulate the implicit behavior when serializing a list/array). When a tag is specified, any records with different tags are silently omitted. The tag is ignored. The tag is ignores for fixed-length prefixes. More... | |
System.Collections.IEnumerable | DeserializeItems (System.IO.Stream source, Type type, PrefixStyle style, int expectedField, Serializer.TypeResolver resolver, SerializationContext context) |
Reads a sequence of consecutive length-prefixed items from a stream, using either base-128 or fixed-length prefixes. Base-128 prefixes with a tag are directly comparable to serializing multiple items in succession (use the Serializer.ListItemTag tag to emulate the implicit behavior when serializing a list/array). When a tag is specified, any records with different tags are silently omitted. The tag is ignored. The tag is ignores for fixed-length prefixes. More... | |
System.Collections.Generic.IEnumerable< T > | DeserializeItems< T > (Stream source, PrefixStyle style, int expectedField) |
Reads a sequence of consecutive length-prefixed items from a stream, using either base-128 or fixed-length prefixes. Base-128 prefixes with a tag are directly comparable to serializing multiple items in succession (use the Serializer.ListItemTag tag to emulate the implicit behavior when serializing a list/array). When a tag is specified, any records with different tags are silently omitted. The tag is ignored. The tag is ignores for fixed-length prefixes. More... | |
System.Collections.Generic.IEnumerable< T > | DeserializeItems< T > (Stream source, PrefixStyle style, int expectedField, SerializationContext context) |
Reads a sequence of consecutive length-prefixed items from a stream, using either base-128 or fixed-length prefixes. Base-128 prefixes with a tag are directly comparable to serializing multiple items in succession (use the Serializer.ListItemTag tag to emulate the implicit behavior when serializing a list/array). When a tag is specified, any records with different tags are silently omitted. The tag is ignored. The tag is ignores for fixed-length prefixes. More... | |
void | SerializeWithLengthPrefix (Stream dest, object value, Type type, PrefixStyle style, int fieldNumber) |
Writes a protocol-buffer representation of the given instance to the supplied stream, with a length-prefix. This is useful for socket programming, as DeserializeWithLengthPrefix can be used to read the single object back from an ongoing stream. More... | |
void | SerializeWithLengthPrefix (Stream dest, object value, Type type, PrefixStyle style, int fieldNumber, SerializationContext context) |
Writes a protocol-buffer representation of the given instance to the supplied stream, with a length-prefix. This is useful for socket programming, as DeserializeWithLengthPrefix can be used to read the single object back from an ongoing stream. More... | |
object | Deserialize (Stream source, object value, System.Type type) |
Applies a protocol-buffer stream to an existing instance (which may be null). More... | |
object | Deserialize (Stream source, object value, System.Type type, SerializationContext context) |
Applies a protocol-buffer stream to an existing instance (which may be null). More... | |
object | Deserialize (Stream source, object value, System.Type type, int length) |
Applies a protocol-buffer stream to an existing instance (which may be null). More... | |
object | Deserialize (Stream source, object value, System.Type type, int length, SerializationContext context) |
Applies a protocol-buffer stream to an existing instance (which may be null). More... | |
object | Deserialize (ProtoReader source, object value, System.Type type) |
Applies a protocol-buffer reader to an existing instance (which may be null). More... | |
bool | IsDefined (Type type) |
Indicates whether the supplied type is explicitly modelled by the model More... | |
object | DeepClone (object value) |
Create a deep clone of the supplied instance; any sub-items are also cloned. More... | |
bool | CanSerializeContractType (Type type) |
Returns true if the type supplied is either a recognised contract type, or a list of a recognised contract type. More... | |
bool | CanSerialize (Type type) |
Returns true if the type supplied is a basic type with inbuilt handling, a recognised contract type, or a list of a basic / contract type. More... | |
bool | CanSerializeBasicType (Type type) |
Returns true if the type supplied is a basic type with inbuilt handling, or a list of a basic type with inbuilt handling More... | |
virtual string | GetSchema (Type type) |
Suggest a .proto definition for the given type More... | |
Static Public Member Functions | |
static RuntimeTypeModel | Create () |
Creates a new runtime model, to which the caller can add support for a range of types. A model can be used "as is", or can be compiled for optimal performance. More... | |
static void | ThrowCannotCreateInstance (Type type) |
Indicates that the given type cannot be constructed; it may still be possible to deserialize into existing instances. More... | |
Protected Member Functions | |
abstract int | GetKeyImpl (Type type) |
Provides the key that represents a given type in the current model. More... | |
Events | |
TypeFormatEventHandler | DynamicTypeFormatting |
Used to provide custom services for writing and parsing type names when using dynamic types. Both parsing and formatting are provided on a single API as it is essential that both are mapped identically at all times. More... | |
Provides protobuf serialization support for a number of types
Definition at line 18 of file TypeModel.cs.
|
inline |
Returns true if the type supplied is a basic type with inbuilt handling, a recognised contract type, or a list of a basic / contract type.
Definition at line 1386 of file TypeModel.cs.
|
inline |
Returns true if the type supplied is a basic type with inbuilt handling, or a list of a basic type with inbuilt handling
Definition at line 1395 of file TypeModel.cs.
|
inline |
Returns true if the type supplied is either a recognised contract type, or a list of a recognised contract type.
Note that primitives always return false, even though the engine will, if forced, try to serialize such
Definition at line 1377 of file TypeModel.cs.
|
inlinestatic |
Creates a new runtime model, to which the caller can add support for a range of types. A model can be used "as is", or can be compiled for optimal performance.
Definition at line 1130 of file TypeModel.cs.
|
inline |
Create a deep clone of the supplied instance; any sub-items are also cloned.
Definition at line 1247 of file TypeModel.cs.
|
inline |
Applies a protocol-buffer stream to an existing instance (which may be null).
type | The type (including inheritance) to consider. |
value | The existing instance to be modified (can be null). |
source | The binary stream to apply to the instance (cannot be null). |
Definition at line 559 of file TypeModel.cs.
|
inline |
Applies a protocol-buffer stream to an existing instance (which may be null).
type | The type (including inheritance) to consider. |
value | The existing instance to be modified (can be null). |
source | The binary stream to apply to the instance (cannot be null). |
context | Additional information about this serialization operation. |
Definition at line 573 of file TypeModel.cs.
|
inline |
Applies a protocol-buffer stream to an existing instance (which may be null).
type | The type (including inheritance) to consider. |
value | The existing instance to be modified (can be null). |
source | The binary stream to apply to the instance (cannot be null). |
length | The number of bytes to consume. |
Definition at line 624 of file TypeModel.cs.
|
inline |
Applies a protocol-buffer stream to an existing instance (which may be null).
type | The type (including inheritance) to consider. |
value | The existing instance to be modified (can be null). |
source | The binary stream to apply to the instance (cannot be null). |
length | The number of bytes to consume (or -1 to read to the end of the stream). |
context | Additional information about this serialization operation. |
Definition at line 639 of file TypeModel.cs.
|
inline |
Applies a protocol-buffer reader to an existing instance (which may be null).
type | The type (including inheritance) to consider. |
value | The existing instance to be modified (can be null). |
source | The reader to apply to the instance (cannot be null). |
Definition at line 663 of file TypeModel.cs.
|
inline |
Reads a sequence of consecutive length-prefixed items from a stream, using either base-128 or fixed-length prefixes. Base-128 prefixes with a tag are directly comparable to serializing multiple items in succession (use the Serializer.ListItemTag tag to emulate the implicit behavior when serializing a list/array). When a tag is specified, any records with different tags are silently omitted. The tag is ignored. The tag is ignores for fixed-length prefixes.
source | The binary stream containing the serialized records. |
style | The prefix style used in the data. |
expectedField | The tag of records to return (if non-positive, then no tag is expected and all records are returned). |
resolver | On a field-by-field basis, the type of object to deserialize (can be null if "type" is specified). |
type | The type of object to deserialize (can be null if "resolver" is specified). |
Definition at line 383 of file TypeModel.cs.
|
inline |
Reads a sequence of consecutive length-prefixed items from a stream, using either base-128 or fixed-length prefixes. Base-128 prefixes with a tag are directly comparable to serializing multiple items in succession (use the Serializer.ListItemTag tag to emulate the implicit behavior when serializing a list/array). When a tag is specified, any records with different tags are silently omitted. The tag is ignored. The tag is ignores for fixed-length prefixes.
source | The binary stream containing the serialized records. |
style | The prefix style used in the data. |
expectedField | The tag of records to return (if non-positive, then no tag is expected and all records are returned). |
resolver | On a field-by-field basis, the type of object to deserialize (can be null if "type" is specified). |
type | The type of object to deserialize (can be null if "resolver" is specified). |
context | Additional information about this serialization operation. |
Definition at line 404 of file TypeModel.cs.
|
inline |
Reads a sequence of consecutive length-prefixed items from a stream, using either base-128 or fixed-length prefixes. Base-128 prefixes with a tag are directly comparable to serializing multiple items in succession (use the Serializer.ListItemTag tag to emulate the implicit behavior when serializing a list/array). When a tag is specified, any records with different tags are silently omitted. The tag is ignored. The tag is ignores for fixed-length prefixes.
T | The type of object to deserialize. |
source | The binary stream containing the serialized records. |
style | The prefix style used in the data. |
expectedField | The tag of records to return (if non-positive, then no tag is expected and all records are returned). |
Definition at line 425 of file TypeModel.cs.
|
inline |
Reads a sequence of consecutive length-prefixed items from a stream, using either base-128 or fixed-length prefixes. Base-128 prefixes with a tag are directly comparable to serializing multiple items in succession (use the Serializer.ListItemTag tag to emulate the implicit behavior when serializing a list/array). When a tag is specified, any records with different tags are silently omitted. The tag is ignored. The tag is ignores for fixed-length prefixes.
T | The type of object to deserialize. |
source | The binary stream containing the serialized records. |
style | The prefix style used in the data. |
expectedField | The tag of records to return (if non-positive, then no tag is expected and all records are returned). |
context | Additional information about this serialization operation. |
Definition at line 445 of file TypeModel.cs.
|
inline |
Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed data - useful with network IO.
type | The type being merged. |
value | The existing instance to be modified (can be null). |
source | The binary stream to apply to the instance (cannot be null). |
style | How to encode the length prefix. |
fieldNumber | The tag used as a prefix to each record (only used with base-128 style prefixes). |
Definition at line 253 of file TypeModel.cs.
|
inline |
Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed data - useful with network IO.
type | The type being merged. |
value | The existing instance to be modified (can be null). |
source | The binary stream to apply to the instance (cannot be null). |
style | How to encode the length prefix. |
expectedField | The tag used as a prefix to each record (only used with base-128 style prefixes). |
resolver | Used to resolve types on a per-field basis. |
Definition at line 273 of file TypeModel.cs.
|
inline |
Applies a protocol-buffer stream to an existing instance (or null), using length-prefixed data - useful with network IO.
type | The type being merged. |
value | The existing instance to be modified (can be null). |
source | The binary stream to apply to the instance (cannot be null). |
style | How to encode the length prefix. |
expectedField | The tag used as a prefix to each record (only used with base-128 style prefixes). |
resolver | Used to resolve types on a per-field basis. |
bytesRead | Returns the number of bytes consumed by this operation (includes length-prefix overheads and any skipped data). |
Definition at line 293 of file TypeModel.cs.
|
protectedpure virtual |
Provides the key that represents a given type in the current model.
Implemented in ProtoBuf.Meta.RuntimeTypeModel.
|
inlinevirtual |
Suggest a .proto definition for the given type
type | The type to generate a .proto definition for, or null to generate a .proto that represents the entire model |
Reimplemented in ProtoBuf.Meta.RuntimeTypeModel.
Definition at line 1440 of file TypeModel.cs.
|
inline |
Indicates whether the supplied type is explicitly modelled by the model
Definition at line 1172 of file TypeModel.cs.
|
inline |
Writes a protocol-buffer representation of the given instance to the supplied stream.
value | The existing instance to be serialized (cannot be null). |
dest | The destination stream to write to. |
Definition at line 200 of file TypeModel.cs.
|
inline |
Writes a protocol-buffer representation of the given instance to the supplied stream.
value | The existing instance to be serialized (cannot be null). |
dest | The destination stream to write to. |
context | Additional information about this serialization operation. |
Definition at line 210 of file TypeModel.cs.
|
inline |
Writes a protocol-buffer representation of the given instance to the supplied writer.
value | The existing instance to be serialized (cannot be null). |
dest | The destination writer to write to. |
Definition at line 228 of file TypeModel.cs.
|
inline |
Writes a protocol-buffer representation of the given instance to the supplied stream, with a length-prefix. This is useful for socket programming, as DeserializeWithLengthPrefix can be used to read the single object back from an ongoing stream.
type | The type being serialized. |
value | The existing instance to be serialized (cannot be null). |
style | How to encode the length prefix. |
dest | The destination stream to write to. |
fieldNumber | The tag used as a prefix to each record (only used with base-128 style prefixes). |
Definition at line 508 of file TypeModel.cs.
|
inline |
Writes a protocol-buffer representation of the given instance to the supplied stream, with a length-prefix. This is useful for socket programming, as DeserializeWithLengthPrefix can be used to read the single object back from an ongoing stream.
type | The type being serialized. |
value | The existing instance to be serialized (cannot be null). |
style | How to encode the length prefix. |
dest | The destination stream to write to. |
fieldNumber | The tag used as a prefix to each record (only used with base-128 style prefixes). |
context | Additional information about this serialization operation. |
Definition at line 524 of file TypeModel.cs.
|
inlinestatic |
Indicates that the given type cannot be constructed; it may still be possible to deserialize into existing instances.
Definition at line 1341 of file TypeModel.cs.
TypeFormatEventHandler ProtoBuf.Meta.TypeModel.DynamicTypeFormatting |
Used to provide custom services for writing and parsing type names when using dynamic types. Both parsing and formatting are provided on a single API as it is essential that both are mapped identically at all times.
Definition at line 1449 of file TypeModel.cs.