RTI Connext C# API Version 7.2.0
|
Allows serializing and deserializing IDL types as byte buffers More...
Inherits IDisposable.
Public Member Functions | |
byte[] | Serialize (T sample) |
Serializes a data sample into a byte array More... | |
unsafe uint | Serialize (T sample, byte *buffer, int length) |
Serializes a data sample into a byte array More... | |
T | Deserialize (byte[] buffer) |
Deserializes a data sample from a byte array More... | |
unsafe T | Deserialize (byte *buffer, int length) |
Deserializes a data sample from a byte buffer More... | |
uint | GetSerializedSampleMaxSize () |
Calculates the maximum number of bytes that any data sample of type T may take in serialized form. More... | |
uint | GetSerializedSampleMinSize () |
Calculates the minimum number of bytes that any data sample of type T may take in serialized form. More... | |
uint | GetSerializedSampleSize (T sample) |
Calculates the exact number of bytes that a given data sample takes in serialized form. More... | |
DynamicData | ToDynamicData (T sample) |
Converts a T sample into a DynamicData sample. More... | |
T | FromDynamicData (DynamicData sample) |
Converts a DynamicData sample into a T sample. More... | |
Allows serializing and deserializing IDL types as byte buffers
T | A type generated from IDL |
To create an ISerializer, use TypeSupport<T>.CreateSerializer.
This type is IDisposable, but it automatically calls Dispose() in its destructor.
This interface has extension methods, see Rti.Dds.Topics.SerializerExtensions .
byte[] Rti.Dds.Topics.ISerializer< T >.Serialize | ( | T | sample | ) |
Serializes a data sample into a byte array
sample | A data sample |
unsafe uint Rti.Dds.Topics.ISerializer< T >.Serialize | ( | T | sample, |
byte * | buffer, | ||
int | length | ||
) |
Serializes a data sample into a byte array
sample | A data sample |
buffer | A byte buffer with enough space to contain the serialized data |
length | The available length of the byte buffer. This operation throws DdsException if the data doesn't fit. You can obtain the exact size required for this sample with GetSerializedSampleSize or a size that is guaranteed to suffice for any sample of this type with GetSerializedSampleMaxSize. |
T Rti.Dds.Topics.ISerializer< T >.Deserialize | ( | byte[] | buffer | ) |
Deserializes a data sample from a byte array
buffer | A byte array containing the serialized data |
unsafe T Rti.Dds.Topics.ISerializer< T >.Deserialize | ( | byte * | buffer, |
int | length | ||
) |
Deserializes a data sample from a byte buffer
buffer | A byte buffer containing the serialized data |
length | The length of the byte buffer |
uint Rti.Dds.Topics.ISerializer< T >.GetSerializedSampleMaxSize | ( | ) |
Calculates the maximum number of bytes that any data sample of type T
may take in serialized form.
uint Rti.Dds.Topics.ISerializer< T >.GetSerializedSampleMinSize | ( | ) |
Calculates the minimum number of bytes that any data sample of type T
may take in serialized form.
uint Rti.Dds.Topics.ISerializer< T >.GetSerializedSampleSize | ( | T | sample | ) |
Calculates the exact number of bytes that a given data sample takes in serialized form.
sample | The data sample |
DynamicData Rti.Dds.Topics.ISerializer< T >.ToDynamicData | ( | T | sample | ) |
Converts a T sample into a DynamicData sample.
sample | The sample to convert |
T Rti.Dds.Topics.ISerializer< T >.FromDynamicData | ( | DynamicData | sample | ) |
Converts a DynamicData sample into a T sample.
sample | The sample to convert |
This method requires that sample.Type and TSupport.Instance.DynamicType be equal.