Space Engineers
Classes | Public Member Functions | Properties | List of all members
ProtoBuf.Meta.MetaType Class Reference

Represents a type at runtime for use with protobuf, allowing the field mappings (etc) to be defined More...

Inheritance diagram for ProtoBuf.Meta.MetaType:
ProtoBuf.Serializers.ISerializerProxy

Classes

class  Comparer
 

Public Member Functions

override string ToString ()
 Get the name of the type being represented More...
 
MetaType AddSubType (int fieldNumber, Type derivedType)
 Adds a known sub-type to the inheritance model More...
 
MetaType AddSubType (int fieldNumber, Type derivedType, DataFormat dataFormat)
 Adds a known sub-type to the inheritance model More...
 
MetaType SetCallbacks (MethodInfo beforeSerialize, MethodInfo afterSerialize, MethodInfo beforeDeserialize, MethodInfo afterDeserialize)
 Assigns the callbacks to use during serialiation/deserialization. More...
 
MetaType SetCallbacks (string beforeSerialize, string afterSerialize, string beforeDeserialize, string afterDeserialize)
 Assigns the callbacks to use during serialiation/deserialization. More...
 
MetaType SetFactory (MethodInfo factory)
 Designate a factory-method to use to create instances of this type More...
 
MetaType SetFactory (string factory)
 Designate a factory-method to use to create instances of this type More...
 
MetaType Add (int fieldNumber, string memberName)
 Adds a member (by name) to the MetaType More...
 
ValueMember AddField (int fieldNumber, string memberName)
 Adds a member (by name) to the MetaType, returning the ValueMember rather than the fluent API. This is otherwise identical to Add. More...
 
MetaType Add (string memberName)
 Adds a member (by name) to the MetaType More...
 
void SetSurrogate (Type surrogateType)
 Performs serialization of this type via a surrogate; all other serialization options are ignored and handled by the surrogate's configuration. More...
 
MetaType Add (params string[] memberNames)
 Adds a set of members (by name) to the MetaType More...
 
MetaType Add (int fieldNumber, string memberName, object defaultValue)
 Adds a member (by name) to the MetaType More...
 
MetaType Add (int fieldNumber, string memberName, Type itemType, Type defaultType)
 Adds a member (by name) to the MetaType, including an itemType and defaultType for representing lists More...
 
ValueMember AddField (int fieldNumber, string memberName, Type itemType, Type defaultType)
 Adds a member (by name) to the MetaType, including an itemType and defaultType for representing lists, returning the ValueMember rather than the fluent API. This is otherwise identical to Add. More...
 
ValueMember[] GetFields ()
 Returns the ValueMember instances associated with this type More...
 
SubType[] GetSubtypes ()
 Returns the SubType instances associated with this type More...
 

Properties

MetaType BaseType [get]
 Gets the base-type for this type More...
 
bool IncludeSerializerMethod [get, set]
 When used to compile a model, should public serialization/deserialzation methods be included for this type? More...
 
bool AsReferenceDefault [get, set]
 Should this type be treated as a reference by default? More...
 
bool HasCallbacks [get]
 Indicates whether the current type has defined callbacks More...
 
bool HasSubtypes [get]
 Indicates whether the current type has defined subtypes More...
 
CallbackSet Callbacks [get]
 Returns the set of callbacks defined for this type More...
 
string Name [get, set]
 Gets or sets the name of this contract. More...
 
Type Type [get]
 The runtime type that the meta-type represents More...
 
bool UseConstructor [get, set]
 Gets or sets whether the type should use a parameterless constructor (the default), or whether the type should skip the constructor completely. This option is not supported on compact-framework. More...
 
Type ConstructType [get, set]
 The concrete type to create when a new instance of this type is needed; this may be useful when dealing with dynamic proxies, or with interface-based APIs More...
 
ValueMember this[int fieldNumber] [get]
 Returns the ValueMember that matchs a given field number, or null if not found More...
 
ValueMember this[MemberInfo member] [get]
 Returns the ValueMember that matchs a given member (property/field), or null if not found More...
 
bool EnumPassthru [get, set]
 Gets or sets a value indicating that an enum should be treated directly as an int/short/etc, rather than enforcing .proto enum rules. This is useful in particul for [Flags] enums. More...
 
bool IgnoreListHandling [get, set]
 Gets or sets a value indicating that this type should NOT be treated as a list, even if it has familiar list-like characteristics (enumerable, add, etc) More...
 
- Properties inherited from ProtoBuf.Serializers.ISerializerProxy
IProtoSerializer Serializer [get]
 

Detailed Description

Represents a type at runtime for use with protobuf, allowing the field mappings (etc) to be defined

Definition at line 28 of file MetaType.cs.

Member Function Documentation

MetaType ProtoBuf.Meta.MetaType.Add ( int  fieldNumber,
string  memberName 
)
inline

Adds a member (by name) to the MetaType

Definition at line 1196 of file MetaType.cs.

MetaType ProtoBuf.Meta.MetaType.Add ( string  memberName)
inline

Adds a member (by name) to the MetaType

Definition at line 1236 of file MetaType.cs.

MetaType ProtoBuf.Meta.MetaType.Add ( params string[]  memberNames)
inline

Adds a set of members (by name) to the MetaType

Definition at line 1307 of file MetaType.cs.

MetaType ProtoBuf.Meta.MetaType.Add ( int  fieldNumber,
string  memberName,
object  defaultValue 
)
inline

Adds a member (by name) to the MetaType

Definition at line 1321 of file MetaType.cs.

MetaType ProtoBuf.Meta.MetaType.Add ( int  fieldNumber,
string  memberName,
Type  itemType,
Type  defaultType 
)
inline

Adds a member (by name) to the MetaType, including an itemType and defaultType for representing lists

Definition at line 1330 of file MetaType.cs.

ValueMember ProtoBuf.Meta.MetaType.AddField ( int  fieldNumber,
string  memberName 
)
inline

Adds a member (by name) to the MetaType, returning the ValueMember rather than the fluent API. This is otherwise identical to Add.

Definition at line 1205 of file MetaType.cs.

ValueMember ProtoBuf.Meta.MetaType.AddField ( int  fieldNumber,
string  memberName,
Type  itemType,
Type  defaultType 
)
inline

Adds a member (by name) to the MetaType, including an itemType and defaultType for representing lists, returning the ValueMember rather than the fluent API. This is otherwise identical to Add.

Definition at line 1340 of file MetaType.cs.

MetaType ProtoBuf.Meta.MetaType.AddSubType ( int  fieldNumber,
Type  derivedType 
)
inline

Adds a known sub-type to the inheritance model

Definition at line 101 of file MetaType.cs.

MetaType ProtoBuf.Meta.MetaType.AddSubType ( int  fieldNumber,
Type  derivedType,
DataFormat  dataFormat 
)
inline

Adds a known sub-type to the inheritance model

Definition at line 108 of file MetaType.cs.

ValueMember [] ProtoBuf.Meta.MetaType.GetFields ( )
inline

Returns the ValueMember instances associated with this type

Definition at line 1517 of file MetaType.cs.

SubType [] ProtoBuf.Meta.MetaType.GetSubtypes ( )
inline

Returns the SubType instances associated with this type

Definition at line 1527 of file MetaType.cs.

MetaType ProtoBuf.Meta.MetaType.SetCallbacks ( MethodInfo  beforeSerialize,
MethodInfo  afterSerialize,
MethodInfo  beforeDeserialize,
MethodInfo  afterDeserialize 
)
inline

Assigns the callbacks to use during serialiation/deserialization.

Parameters
beforeSerializeThe method (or null) called before serialization begins.
afterSerializeThe method (or null) called when serialization is complete.
beforeDeserializeThe method (or null) called before deserialization begins (or when a new instance is created during deserialization).
afterDeserializeThe method (or null) called when deserialization is complete.
Returns
The set of callbacks.

Definition at line 202 of file MetaType.cs.

MetaType ProtoBuf.Meta.MetaType.SetCallbacks ( string  beforeSerialize,
string  afterSerialize,
string  beforeDeserialize,
string  afterDeserialize 
)
inline

Assigns the callbacks to use during serialiation/deserialization.

Parameters
beforeSerializeThe name of the method (or null) called before serialization begins.
afterSerializeThe name of the method (or null) called when serialization is complete.
beforeDeserializeThe name of the method (or null) called before deserialization begins (or when a new instance is created during deserialization).
afterDeserializeThe name of the method (or null) called when deserialization is complete.
Returns
The set of callbacks.

Definition at line 219 of file MetaType.cs.

MetaType ProtoBuf.Meta.MetaType.SetFactory ( MethodInfo  factory)
inline

Designate a factory-method to use to create instances of this type

Definition at line 294 of file MetaType.cs.

MetaType ProtoBuf.Meta.MetaType.SetFactory ( string  factory)
inline

Designate a factory-method to use to create instances of this type

Definition at line 307 of file MetaType.cs.

void ProtoBuf.Meta.MetaType.SetSurrogate ( Type  surrogateType)
inline

Performs serialization of this type via a surrogate; all other serialization options are ignored and handled by the surrogate's configuration.

Definition at line 1247 of file MetaType.cs.

override string ProtoBuf.Meta.MetaType.ToString ( )
inline

Get the name of the type being represented

Definition at line 56 of file MetaType.cs.

Property Documentation

bool ProtoBuf.Meta.MetaType.AsReferenceDefault
getset

Should this type be treated as a reference by default?

Definition at line 84 of file MetaType.cs.

MetaType ProtoBuf.Meta.MetaType.BaseType
get

Gets the base-type for this type

Definition at line 65 of file MetaType.cs.

CallbackSet ProtoBuf.Meta.MetaType.Callbacks
get

Returns the set of callbacks defined for this type

Definition at line 175 of file MetaType.cs.

Type ProtoBuf.Meta.MetaType.ConstructType
getset

The concrete type to create when a new instance of this type is needed; this may be useful when dealing with dynamic proxies, or with interface-based APIs

Definition at line 1224 of file MetaType.cs.

bool ProtoBuf.Meta.MetaType.EnumPassthru
getset

Gets or sets a value indicating that an enum should be treated directly as an int/short/etc, rather than enforcing .proto enum rules. This is useful in particul for [Flags] enums.

Definition at line 1590 of file MetaType.cs.

bool ProtoBuf.Meta.MetaType.HasCallbacks
get

Indicates whether the current type has defined callbacks

Definition at line 159 of file MetaType.cs.

bool ProtoBuf.Meta.MetaType.HasSubtypes
get

Indicates whether the current type has defined subtypes

Definition at line 167 of file MetaType.cs.

bool ProtoBuf.Meta.MetaType.IgnoreListHandling
getset

Gets or sets a value indicating that this type should NOT be treated as a list, even if it has familiar list-like characteristics (enumerable, add, etc)

Definition at line 1600 of file MetaType.cs.

bool ProtoBuf.Meta.MetaType.IncludeSerializerMethod
getset

When used to compile a model, should public serialization/deserialzation methods be included for this type?

Definition at line 75 of file MetaType.cs.

string ProtoBuf.Meta.MetaType.Name
getset

Gets or sets the name of this contract.

Definition at line 278 of file MetaType.cs.

ValueMember ProtoBuf.Meta.MetaType.this[int fieldNumber]
get

Returns the ValueMember that matchs a given field number, or null if not found

Definition at line 1487 of file MetaType.cs.

ValueMember ProtoBuf.Meta.MetaType.this[MemberInfo member]
get

Returns the ValueMember that matchs a given member (property/field), or null if not found

Definition at line 1501 of file MetaType.cs.

Type ProtoBuf.Meta.MetaType.Type
get

The runtime type that the meta-type represents

Definition at line 365 of file MetaType.cs.

bool ProtoBuf.Meta.MetaType.UseConstructor
getset

Gets or sets whether the type should use a parameterless constructor (the default), or whether the type should skip the constructor completely. This option is not supported on compact-framework.

Definition at line 1215 of file MetaType.cs.


The documentation for this class was generated from the following file: