RTI Connext C# API Version 7.3.0
Rti.Dds.Topics.TypeSupport< T > Class Template Reference

Base class for IDL-generated type support classes. It allows getting the DynamicType that describes the type T. More...

Inheritance diagram for Rti.Dds.Topics.TypeSupport< T >:
Rti.Dds.Topics.ITypeSupport

Public Member Functions

ISerializer< T > CreateSerializer (short dataRepresentation=Core.Policy.DataRepresentation.Xcdr)
 Creates an ISerializer that allows serializing and deserializing data as byte arrays. More...
 
string ToString (T sample)
 Converts a data sample into a readable string. More...
 
string ToString (T sample, PrintFormatProperty format)
 Converts a data sample into a string representation such as XML or JSON according to the specified formatting options. More...
 
FromString (string str, PrintFormatKind formatKind=PrintFormatKind.Json)
 Creates a data sample from a JSON string representation More...
 
DynamicType GetDynamicTypeInternal (bool isPublic=true)
 For internal use only. More...
 
virtual void RegisterType (DomainParticipant participant, string typeName)
 For internal use only. More...
 
TAttribute GetAttribute< TAttribute > (string propertyName)
 Gets an Attribute (such as Omg.Types.KeyAttribute) from a property of this TypeSupport's type, T. More...
 
virtual void Dispose ()
 For internal use only. More...
 

Protected Member Functions

 TypeSupport (ITypePlugin plugin, Lazy< DynamicType > dynamicTypeConstructor)
 For internal use only. More...
 

Properties

DynamicType DynamicType [get]
 The DynamicType that describes the IDL type T. More...
 
- Properties inherited from Rti.Dds.Topics.ITypeSupport
DynamicType DynamicType [get]
 The DynamicType that describes the IDL type. More...
 

Detailed Description

Base class for IDL-generated type support classes. It allows getting the DynamicType that describes the type T.

Template Parameters
TThe IDL type managed by this TypeSupport

Constructor & Destructor Documentation

◆ TypeSupport()

Rti.Dds.Topics.TypeSupport< T >.TypeSupport ( ITypePlugin  plugin,
Lazy< DynamicType dynamicTypeConstructor 
)
inlineprotected

For internal use only.

Member Function Documentation

◆ CreateSerializer()

ISerializer< T > Rti.Dds.Topics.TypeSupport< T >.CreateSerializer ( short  dataRepresentation = Core.Policy.DataRepresentation.Xcdr)

Creates an ISerializer that allows serializing and deserializing data as byte arrays.

Parameters
dataRepresentationThe binary format that the serializer will use. The supported options are Core.Policy.DataRepresentation.Xcdr (default) and Core.Policy.DataRepresentation.Xcdr2

◆ ToString() [1/2]

string Rti.Dds.Topics.TypeSupport< T >.ToString ( sample)
inline

Converts a data sample into a readable string.

Parameters
sampleThe data sample to stringify
Returns
A string representation of the data sample

◆ ToString() [2/2]

string Rti.Dds.Topics.TypeSupport< T >.ToString ( sample,
PrintFormatProperty  format 
)
inline

Converts a data sample into a string representation such as XML or JSON according to the specified formatting options.

Parameters
sampleThe data sample to stringify
formatThe format options
Returns
A string representation of the data sample

◆ FromString()

T Rti.Dds.Topics.TypeSupport< T >.FromString ( string  str,
PrintFormatKind  formatKind = PrintFormatKind.Json 
)
inline

Creates a data sample from a JSON string representation

Parameters
strThe json representation of the data
formatKindThe format kind of the string representation (the default and only supported value is PrintFormatKind.Json)
Returns
An instance of type T

◆ GetDynamicTypeInternal()

DynamicType Rti.Dds.Topics.TypeSupport< T >.GetDynamicTypeInternal ( bool  isPublic = true)

For internal use only.

◆ RegisterType()

virtual void Rti.Dds.Topics.TypeSupport< T >.RegisterType ( DomainParticipant  participant,
string  typeName 
)
virtual

For internal use only.

◆ GetAttribute< TAttribute >()

TAttribute Rti.Dds.Topics.TypeSupport< T >.GetAttribute< TAttribute > ( string  propertyName)
inline

Gets an Attribute (such as Omg.Types.KeyAttribute) from a property of this TypeSupport's type, T.

Parameters
propertyNameThe name of a property of the type T
Template Parameters
TAttributeThe attribute type such as Omg.Types.KeyAttribute
Returns
The attribute definition if this property has it or null if it doesn't.
Exceptions
ArgumentExceptionIf the property doesn't exist in this type

Some IDL annotations are mapped to C# attributes. This helper method can retrieve these attributes using C# reflection.

Type Constraints
TAttribute :Attribute 

◆ Dispose()

virtual void Rti.Dds.Topics.TypeSupport< T >.Dispose ( )
inlinevirtual

For internal use only.

Property Documentation

◆ DynamicType

The DynamicType that describes the IDL type T.

Implements Rti.Dds.Topics.ITypeSupport.