RTI Connext C# API  6.1.2
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 TypeSupport< T >:
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...
 
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 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()

TypeSupport ( ITypePlugin  plugin,
Lazy< DynamicType dynamicTypeConstructor 
)
protected

For internal use only.

Member Function Documentation

◆ CreateSerializer()

ISerializer<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

◆ Dispose()

virtual void Dispose ( )
virtual

For internal use only.

◆ GetAttribute< TAttribute >()

TAttribute GetAttribute< TAttribute > ( string  propertyName)

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 

◆ GetDynamicTypeInternal()

DynamicType GetDynamicTypeInternal ( bool  isPublic = true)

For internal use only.

◆ RegisterType()

virtual void RegisterType ( DomainParticipant  participant,
string  typeName 
)
virtual

For internal use only.

◆ ToString() [1/2]

string ToString ( sample)

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 ToString ( sample,
PrintFormatProperty  format 
)

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

Property Documentation

◆ DynamicType

The DynamicType that describes the IDL type T.