Mercury Messaging
Documentation for the Mercury Messaging Framework
MercuryMessaging.MmMessageSerializable Class Reference

MmMessage that sends a serialized object as payload You need to assign your implementation of the IMSerializable interface to the Serializable types somewhere in your program. Additionally, you need to invoke the AssignType function manually if you do not create the message using the constructor with an IMSerializable as a parameter or the copy constructor. More...

Inheritance diagram for MercuryMessaging.MmMessageSerializable:
MercuryMessaging.MmMessage

Public Member Functions

 MmMessageSerializable ()
 Creates a basic MmMessageSerializable More...
 
 MmMessageSerializable (MmMetadataBlock metadataBlock=null)
 Creates a basic MmMessageSerializable, with a control block More...
 
 MmMessageSerializable (IMmSerializable iVal, MmMethod mmMethod=default(MmMethod), MmMetadataBlock metadataBlock=null)
 Create an MmMessage, with control block, MmMethod, and an int More...
 
 MmMessageSerializable (MmMessageSerializable message)
 Duplicate an MmMessageSerializable More...
 
override MmMessage Copy ()
 Message copy method More...
 
override void Deserialize (NetworkReader reader)
 Deserialize the message More...
 
override void Serialize (NetworkWriter writer)
 Serialize the MmMessage More...
 
void AssignType ()
 Attempt to determine type of the value, then lookup in the types dictionary then assign to numerical value for transfer Sample code from: https://stackoverflow.com/questions/2444033/get-dictionary-key-by-value More...
 
- Public Member Functions inherited from MercuryMessaging.MmMessage
 MmMessage ()
 Creates a basic MmMessage with a default control block More...
 
 MmMessage (MmMetadataBlock metadataBlock)
 Creates a basic MmMessage with the passed control block. More...
 
 MmMessage (MmMethod mmMethod, MmMetadataBlock metadataBlock=null)
 Create an MmMessage, with defined control block and MmMethod More...
 
 MmMessage (MmMethod mmMethod, MmLevelFilter levelFilter, MmActiveFilter activeFilter, MmSelectedFilter selectedFilter, MmNetworkFilter networkFilter)
 Create an MmMessage, with filters defined directly More...
 
 MmMessage (MmMessage message)
 Duplicate an MmMessage More...
 
override void Deserialize (NetworkReader reader)
 Deserialize the MmMessage More...
 
override void Serialize (NetworkWriter writer)
 Serialize the MmMessage More...
 

Public Attributes

int SerializableType
 Type of payload More...
 
IMmSerializable value
 Serialized item Payload Item needs to implement IMmSerializable More...
 
- Public Attributes inherited from MercuryMessaging.MmMessage
MmMethod MmMethod
 The MmMethod invoked by the calling object. More...
 
MmMetadataBlock MetadataBlock
 Control parameters designating how a message should traverse an MercuryMessaging Hierarchy. More...
 
uint NetId
 Network identifier of sender/recipient objects. More...
 
bool root = true
 Deprecated - remove in next version More...
 
string TimeStamp
 Message timestamp, assists in collision avoidance More...
 

Static Public Attributes

static readonly Dictionary< int, Type > SerializableTypes = new Dictionary<int, Type>()
 Dictionary enumerating supported serialized types More...
 

Additional Inherited Members

- Properties inherited from MercuryMessaging.MmMessage
bool IsDeserialized [get]
 Utilized by Mercury serialization/deserialization systems. More...
 

Detailed Description

MmMessage that sends a serialized object as payload You need to assign your implementation of the IMSerializable interface to the Serializable types somewhere in your program. Additionally, you need to invoke the AssignType function manually if you do not create the message using the constructor with an IMSerializable as a parameter or the copy constructor.

Constructor & Destructor Documentation

◆ MmMessageSerializable() [1/4]

MercuryMessaging.MmMessageSerializable.MmMessageSerializable ( )

Creates a basic MmMessageSerializable

◆ MmMessageSerializable() [2/4]

MercuryMessaging.MmMessageSerializable.MmMessageSerializable ( MmMetadataBlock  metadataBlock = null)

Creates a basic MmMessageSerializable, with a control block

Parameters
metadataBlockObject defining the routing of messages

◆ MmMessageSerializable() [3/4]

MercuryMessaging.MmMessageSerializable.MmMessageSerializable ( IMmSerializable  iVal,
MmMethod  mmMethod = default(MmMethod),
MmMetadataBlock  metadataBlock = null 
)

Create an MmMessage, with control block, MmMethod, and an int

Parameters
iValSerializable Payload
mmMethodIdentifier of target MmMethod
metadataBlockObject defining the routing of messages

◆ MmMessageSerializable() [4/4]

MercuryMessaging.MmMessageSerializable.MmMessageSerializable ( MmMessageSerializable  message)

Duplicate an MmMessageSerializable

Parameters
messageItem to duplicate

Member Function Documentation

◆ AssignType()

void MercuryMessaging.MmMessageSerializable.AssignType ( )

Attempt to determine type of the value, then lookup in the types dictionary then assign to numerical value for transfer Sample code from: https://stackoverflow.com/questions/2444033/get-dictionary-key-by-value

◆ Copy()

override MmMessage MercuryMessaging.MmMessageSerializable.Copy ( )
virtual

Message copy method

Returns
Duplicate of MmMessage

Reimplemented from MercuryMessaging.MmMessage.

◆ Deserialize()

override void MercuryMessaging.MmMessageSerializable.Deserialize ( NetworkReader  reader)

Deserialize the message

Parameters
readerUNET based deserializer object

◆ Serialize()

override void MercuryMessaging.MmMessageSerializable.Serialize ( NetworkWriter  writer)

Serialize the MmMessage

Parameters
writerUNET based serializer

Member Data Documentation

◆ SerializableType

int MercuryMessaging.MmMessageSerializable.SerializableType

Type of payload

◆ SerializableTypes

readonly Dictionary<int, Type> MercuryMessaging.MmMessageSerializable.SerializableTypes = new Dictionary<int, Type>()
static

Dictionary enumerating supported serialized types

◆ value

IMmSerializable MercuryMessaging.MmMessageSerializable.value

Serialized item Payload Item needs to implement IMmSerializable


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