RTI Connext C# API  6.1.0
DynamicTypeFactory Class Reference

A factory for creating DynamicTypes. More...

Inherits IDisposable.

Inherited by MonotonicDynamicTypeFactory.

Classes

struct  WideCharType
 An empty struct used only as a type argument to GetPrimitiveType<T> to disambiguate between IDL char (UTF-8 character) and IDL wchar (UTF-16 character). More...
 

Public Member Functions

PrimitiveType< T > GetPrimitiveType< T > ()
 Gets the DynamicType that represents a primitive type. More...
 
DynamicType GetPrimitiveType (TypeKind primitiveKind)
 Gets the DynamicType that represents a primitive type. More...
 
StructBuilder BuildStruct ()
 Returns a StructBuilder that allows creating an StructType. More...
 
StructBuilder BuildStruct (StructType structType)
 Returns a builder that allows creating a new StructType from an existing StructType. More...
 
UnionBuilder BuildUnion ()
 Returns a UnionBuilder that allows creating an UnionType. More...
 
UnionBuilder BuildUnion (UnionType unionType)
 Returns a builder that allows creating a new UnionType from an existing UnionType. More...
 
EnumBuilder BuildEnum ()
 Returns an EnumBuilder that allows creating an EnumType. More...
 
EnumBuilder BuildEnum (EnumType enumType)
 Returns a builder that allows creating a new EnumType from an existing EnumType. More...
 
virtual StringType CreateString (uint bounds=StringType.Unbounded)
 Creates a StringType with the given bounds. More...
 
virtual WideStringType CreateWideString (uint bounds=WideStringType.Unbounded)
 Creates a WideStringType with the given bounds. More...
 
virtual SequenceType CreateSequence (DynamicType elementType, uint bounds=uint.MaxValue)
 Creates a SequenceType of a certain type and bounds. More...
 
ArrayType CreateArray (DynamicType elementType, uint singleDimension)
 Creates a single-dimension ArrayType of a certain type and size. More...
 
virtual ArrayType CreateArray (DynamicType elementType, IEnumerable< uint > dimensions)
 Creates an ArrayType of a certain type and specified dimensions. More...
 
virtual AliasType CreateAlias (string name, DynamicType relatedType, bool isExternal=false)
 Creates an AliasType. More...
 
virtual void Dispose ()
 Disposes the DynamicTypeFactory. More...
 

Properties

static DynamicTypeFactory Instance [get]
 A singleton for the factory. More...
 

Detailed Description

A factory for creating DynamicTypes.

The full documentation is available in the C API: DDS_TypeCodeFactory

Member Function Documentation

◆ BuildEnum() [1/2]

EnumBuilder BuildEnum ( )

Returns an EnumBuilder that allows creating an EnumType.

Returns
A new empty builder to create a new EnumType.

◆ BuildEnum() [2/2]

EnumBuilder BuildEnum ( EnumType  enumType)

Returns a builder that allows creating a new EnumType from an existing EnumType.

Parameters
enumTypeThe type to duplicate
Returns
A builder that contains the information about the input EnumType. Use this builder to update its properties, add or remove members, etc.

◆ BuildStruct() [1/2]

StructBuilder BuildStruct ( )

Returns a StructBuilder that allows creating an StructType.

Returns
A new empty builder to create a new StructType.

◆ BuildStruct() [2/2]

StructBuilder BuildStruct ( StructType  structType)

Returns a builder that allows creating a new StructType from an existing StructType.

Parameters
structTypeThe type to duplicate
Returns
A builder that contains the information about the input StructType. Use this builder to update its properties, add or remove members, etc.

◆ BuildUnion() [1/2]

UnionBuilder BuildUnion ( )

Returns a UnionBuilder that allows creating an UnionType.

Returns
A new empty builder to create a new UnionType.

◆ BuildUnion() [2/2]

UnionBuilder BuildUnion ( UnionType  unionType)

Returns a builder that allows creating a new UnionType from an existing UnionType.

Parameters
unionTypeThe type to duplicate
Returns
A builder that contains the information about the input UnionType. Use this builder to update its properties, add or remove members, etc.

◆ CreateAlias()

virtual AliasType CreateAlias ( string  name,
DynamicType  relatedType,
bool  isExternal = false 
)
virtual

Creates an AliasType.

Parameters
nameThe type name
relatedTypeThe aliased type
isExternalWhether the aliased type is external

◆ CreateArray() [1/2]

virtual ArrayType CreateArray ( DynamicType  elementType,
IEnumerable< uint >  dimensions 
)
virtual

Creates an ArrayType of a certain type and specified dimensions.

Parameters
elementTypeThe DynamicType of the elements contained in the array.
dimensionsSize for each of the dimensions in the array.

◆ CreateArray() [2/2]

ArrayType CreateArray ( DynamicType  elementType,
uint  singleDimension 
)

Creates a single-dimension ArrayType of a certain type and size.

Parameters
elementTypeThe DynamicType of the elements contained in the array.
singleDimensionThe size of the array.

◆ CreateSequence()

virtual SequenceType CreateSequence ( DynamicType  elementType,
uint  bounds = uint.MaxValue 
)
virtual

Creates a SequenceType of a certain type and bounds.

Parameters
elementTypeThe DynamicType of the elements contained in the sequence.
boundsThe bounds for a sequence SequenceType.Bounds. For unlimited bounds, use SequenceType.Unbounded.

◆ CreateString()

virtual StringType CreateString ( uint  bounds = StringType.Unbounded)
virtual

Creates a StringType with the given bounds.

Parameters
boundsThe bounds for a string StringType.Bounds. For unlimited bounds, use StringType.Unbounded.

◆ CreateWideString()

virtual WideStringType CreateWideString ( uint  bounds = WideStringType.Unbounded)
virtual

Creates a WideStringType with the given bounds.

Parameters
boundsThe bounds for a wide string WideStringType.Bounds. For unlimited bounds, use WideStringType.Unbounded.

◆ Dispose()

virtual void Dispose ( )
virtual

Disposes the DynamicTypeFactory.

Note: it is not necessary to manually dispose this object.

◆ GetPrimitiveType()

DynamicType GetPrimitiveType ( TypeKind  primitiveKind)

Gets the DynamicType that represents a primitive type.

Parameters
primitiveKindA type kind represneting a primitive type, such as TypeKind.Int32.
Exceptions
ArgumentExceptionWhen primitiveKind is not a primitive TypeKind

◆ GetPrimitiveType< T >()

Gets the DynamicType that represents a primitive type.

Template Parameters
TThe primitive type to obtain, such as int

See also GetPrimitiveType(TypeKind)

Exceptions
ArgumentExceptionWhen T is not a valid primitive type.

Property Documentation

◆ Instance

DynamicTypeFactory Instance
staticget

A singleton for the factory.