CoreDX DDS C++ Reference Manual
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
DDS::DynamicTypeBuilderFactory Class Referenceabstract

An instance of this type is responsible for creating DynamicType and DynamicTypeSupport objects. More...

Public Member Functions

virtual class DynamicTypeget_primitive_type (const TypeKind kind)=0
 Retrieve a DynamicType object corresponding to the indicated primitive type kind. More...
 
virtual class DynamicTypeBuildercreate_type (const class TypeDescriptor *descriptor)=0
 Create and return a new DDS_DynamicTypeBuilder object as described by the given type descriptor. More...
 
virtual class DynamicTypeBuildercreate_type_copy (const class DynamicType *type)=0
 Create and return a new DDS_DynamicTypeBuilder object with a copy of the state of the given type. More...
 
virtual class DynamicTypeBuildercreate_type_w_type_object (const struct TypeObject *type_object)=0
 Create and return a new DynamicTypeBuilder object that describes a type identical to that described by the given TypeObject. More...
 
virtual class DynamicTypeBuildercreate_string_type (const unsigned int bound)=0
 Create and return a new DynamicTypeBuilder object representing a string type. More...
 
virtual class DynamicTypeBuildercreate_wstring_type (const unsigned int bound)=0
 Create and return a new DynamicTypeBuilder object representing a string type. More...
 
virtual class DynamicTypeBuildercreate_sequence_type (const class DynamicType *element_type, const unsigned int bound)=0
 Create and return a new DynamicTypeBuilder object representing a sequence type. More...
 
virtual class DynamicTypeBuildercreate_array_type (const class DynamicType *element_type, const BoundSeq *bound)=0
 Create and return a new DynamicTypeBuilder object representing an array type. More...
 
virtual class DynamicTypeBuildercreate_map_type (const class DynamicType *key_element_type, const class DynamicType *element_type, const unsigned int bound)=0
 Create and return a new DynamicTypeBuilder object representing a map type. More...
 
virtual class DynamicTypeBuildercreate_bitset_type (const unsigned int bound)=0
 Create and return a new DynamicTypeBuilder object representing a bit set type. More...
 
virtual class DynamicTypeBuildercreate_type_w_uri (const char *document_url, const char *type_name, const IncludePathSeq *include_paths)=0
 Create and return a new DynamicTypeBuilder object by parsing the type description at the given URL. More...
 
virtual class DynamicTypeBuildercreate_type_w_document (const char *document, const char *type_name, const IncludePathSeq *include_paths)=0
 Create and return a new DynamicTypeBuilder object by parsing the type description contained in the given string. More...
 
virtual class DynamicTypeBuildercreate_structure_type ()=0
 Create and return a new DynamicTypeBuilder object representing a structure type. More...
 
virtual class DynamicTypeBuildercreate_union_type ()=0
 Create and return a new DynamicTypeBuilder object representing a union type. More...
 
virtual class DynamicTypeBuildercreate_alias_type (const DynamicType *base_type)=0
 Create and return a new DDS_DynamicTypeBuilder object representing an alias for the provided 'base_type'. More...
 
virtual class DynamicTypeBuildercreate_enumeration_type (const unsigned int bound=32)=0
 Create and return a new DynamicTypeBuilder object representing an enumeration type. More...
 
virtual ReturnCode_t delete_type_builder (class DynamicTypeBuilder *dtb)=0
 Destroy a DynamicTypeBuilder instance obtained through one of the create methods on the DynamicTypeBuilderFactory. More...
 
virtual ReturnCode_t delete_type (class DynamicType *type)=0
 Destroy a DynamicType instance obtained through the DynamicTypeBuilderFactory::get_primitive_type operation. More...
 

Static Public Member Functions

static DynamicTypeBuilderFactoryget_instance ()
 Return the DDS_DynamicTypeBuilderFactory singleton instance. More...
 
static ReturnCode_t delete_instance ()
 Reclaim any resources associated with the instance returned from DynamicTypeBuilderFactory::get_instance. More...
 

Protected Member Functions

 DynamicTypeBuilderFactory ()
 

Detailed Description

An instance of this type is responsible for creating DynamicType and DynamicTypeSupport objects.

See also
DynamicType
DynamicTypeBuilder
DynamicTypeSupport

Constructor & Destructor Documentation

DDS::DynamicTypeBuilderFactory::DynamicTypeBuilderFactory ( )
protected

Constructor, Copy Constructor, Destructor, Assignment operator

Member Function Documentation

virtual class DynamicTypeBuilder* DDS::DynamicTypeBuilderFactory::create_alias_type ( const DynamicType base_type)
pure virtual

Create and return a new DDS_DynamicTypeBuilder object representing an alias for the provided 'base_type'.

This is a convenience routine, in place of calling DynamicTypeBuilder::create_type() directly. The alias type refers to the 'base_type' parameter.

Return values
nilIn the case of an error
virtual class DynamicTypeBuilder* DDS::DynamicTypeBuilderFactory::create_array_type ( const class DynamicType element_type,
const BoundSeq *  bound 
)
pure virtual

Create and return a new DynamicTypeBuilder object representing an array type.

All objects returned by this operation should eventually be deleted by calling DynamicTypeBuilderFactory::delete_type_builder.

All array types having equal element types, an equal number of dimensions, and equal bounds in each dimension shall be considered equal.

The type of all objects that can be stored in an array of the new type is specified by parameter 'element_type'.

The 'bound' parameter is a collection of unsigned integers, the length of which is equal to the number of dimensions in the new array type, and the values of which are the bounds of each dimension. (For example, a three-by-two array would be described by a collection of length two, where the first element had a value of three and the second a value of two.)

Return values
nilIf any parameters are invalid or an error occurs.
virtual class DynamicTypeBuilder* DDS::DynamicTypeBuilderFactory::create_bitset_type ( const unsigned int  bound)
pure virtual

Create and return a new DynamicTypeBuilder object representing a bit set type.

All objects returned by this operation should eventually be deleted by calling DynamicTypeBuilderFactory::delete_type_builder.

Parameter bound - The number of reserved bits in the bit set.

Return values
nilIf an error occurs, for example if the bound is out of range.
virtual class DynamicTypeBuilder* DDS::DynamicTypeBuilderFactory::create_enumeration_type ( const unsigned int  bound = 32)
pure virtual

Create and return a new DynamicTypeBuilder object representing an enumeration type.

This is a convenience routine, in place of calling DynamicTypeBuilder::create_type() directly. The enumeration type of the result returned shall initially contain no members.

Return values
nilIn the case of an error
virtual class DynamicTypeBuilder* DDS::DynamicTypeBuilderFactory::create_map_type ( const class DynamicType key_element_type,
const class DynamicType element_type,
const unsigned int  bound 
)
pure virtual

Create and return a new DynamicTypeBuilder object representing a map type.

All objects returned by this operation should eventually be deleted by calling DynamicTypeBuilderFactory::delete_type_builder.

All map types having equal key and value element types and equal bounds shall be considered equal.

Parameter key_element_type - The type of all objects that can be stored as keys in a map of the new type.

Parameter element_type - The type of all objects that can be stored as values in a map of the new type.

Parameter bound - The maximum number of key-value pairs that may be stored in a map of the new type. If this argument is equal to LENGTH_UNLIMITED, the map type shall be considered to be unbounded.

Return values
nilIf an error occurs, or any parameter is invalid
virtual class DynamicTypeBuilder* DDS::DynamicTypeBuilderFactory::create_sequence_type ( const class DynamicType element_type,
const unsigned int  bound 
)
pure virtual

Create and return a new DynamicTypeBuilder object representing a sequence type.

All objects returned by this operation should eventually be deleted by calling DynamicTypeBuilderFactory::delete_type_builder.

All sequence types having equal element types and equal bounds shall be considered equal.

The type of all objects that can be stored in a sequence of the new type is specified by the 'element_type' parameter.

The maximum number of elements that may be stored in a sequence of the new type is specified by the 'bound' parameter. If this argument is equal to DDS_LENGTH_UNLIMITED, the sequence type shall be considered to be unbounded.

Return values
nilIf an error occurs, or any parameters are invalid
virtual class DynamicTypeBuilder* DDS::DynamicTypeBuilderFactory::create_string_type ( const unsigned int  bound)
pure virtual

Create and return a new DynamicTypeBuilder object representing a string type.

The element type of the result returned by this operation is Char8.

All string types having equal element types and equal bounds shall be considered equal.

The maximum number of elements that may be stored in a string of the new type is specified by parameter 'bound'. If this argument is equal to LENGTH_UNLIMITED, the string type shall be unbounded.

Return values
nilIf an error occurs
virtual class DynamicTypeBuilder* DDS::DynamicTypeBuilderFactory::create_structure_type ( )
pure virtual

Create and return a new DynamicTypeBuilder object representing a structure type.

This is a convenience routine, in place of calling DynamicTypeBuilder::create_type() directly. The structure type of the result returned shall initially contain no members.

Return values
nilIn the case of an error a
virtual class DynamicTypeBuilder* DDS::DynamicTypeBuilderFactory::create_type ( const class TypeDescriptor descriptor)
pure virtual

Create and return a new DDS_DynamicTypeBuilder object as described by the given type descriptor.

This method is the conventional mechanism for creating structured, enumeration, and alias types, although it can also be used to create types of other kinds. All objects returned by this operation should eventually be deleted by calling DynamicTypeBuilderFactory::delete_type.

The properties of the new type to create is provided by the 'descriptor' parameter.

Return values
nilIf the descriptor parameter is nil or inconsistent (as indicated by its is_consistent operation)
virtual class DynamicTypeBuilder* DDS::DynamicTypeBuilderFactory::create_type_copy ( const class DynamicType type)
pure virtual

Create and return a new DDS_DynamicTypeBuilder object with a copy of the state of the given type.

All objects returned by this operation should eventually be deleted by calling DynamicTypeBuilderFactory::delete_type_builder. The initial state of the new type to create is described by the parameter 'type'.

Return values
nilIf parameter 'type' is nil
virtual class DynamicTypeBuilder* DDS::DynamicTypeBuilderFactory::create_type_w_document ( const char *  document,
const char *  type_name,
const IncludePathSeq *  include_paths 
)
pure virtual

Create and return a new DynamicTypeBuilder object by parsing the type description contained in the given string.

Applications shall be able to reclaim resources associated with the type returned by this method by calling DynamicTypeBuilderFactory::delete_type_builder, just as if the resultant type was created by one of the create methods of this class.

Parameter document - A type description document, which shall be parsed to create the DynamicType object. Implementations shall minimally support the XML Type Description format for loaded documents and may support additional Type Descriptions.

Parameter type_name - The fully qualified name of the type to be loaded from the document. If no type exists of this name in the document, the operation shall fail and return a nil result.

Parameter include_paths - A collection of URLs to directories to be searched for additional type description documents that may be included, directly or indirectly, by the document argument. Implementations shall minimally support the file: URL scheme and may support additional schemes.

Return values
nilIf an error occurs
Not Yet Supported:
This operation is not yet implemented.
virtual class DynamicTypeBuilder* DDS::DynamicTypeBuilderFactory::create_type_w_type_object ( const struct TypeObject *  type_object)
pure virtual

Create and return a new DynamicTypeBuilder object that describes a type identical to that described by the given TypeObject.

Subsequent changes to the new DDS_DynamicTypeBuilder object shall not impact the input TypeObject 'type_object'. All objects returned by this operation should eventually be deleted by calling DynamicTypeBuilderFactory::delete_type_builder.

Return values
nilIf the type_object parameter is invalid
virtual class DynamicTypeBuilder* DDS::DynamicTypeBuilderFactory::create_type_w_uri ( const char *  document_url,
const char *  type_name,
const IncludePathSeq *  include_paths 
)
pure virtual

Create and return a new DynamicTypeBuilder object by parsing the type description at the given URL.

Applications shall be able to reclaim resources associated with the type returned by this method by calling DynamicTypeBuilderFactory::delete_type_builder, just as if the resultant type was created by one of the create methods of this class.

Parameter document_url - A URL that indicates a type description document, which shall be parsed to create the DynamicType object. Implementations shall minimally support the file: URL scheme and may support additional schemes. Implementations shall minimally support the XML Type Description format for loaded documents and may support additional Type Descriptions.

Parameter type_name - The fully qualified name of the type to be loaded from the document that is the target of the URL. If no type exists of this name in the document, the operation shall fail and return a nil result.

Parameter include_paths - A collection of URLs to directories to be searched for additional type description documents that may be included, directly or indirectly, by the document that is the target of document_url. The directory in which the target of document_url resides shall be considered on the inclusion search path implicitly and need not be included in this collection. Implementations shall minimally support the file: URL scheme and may support additional schemes.

Return values
nilIf an error occurs, or if any parameters are invalid
Not Yet Supported:
This operation is not yet implemented.
virtual class DynamicTypeBuilder* DDS::DynamicTypeBuilderFactory::create_union_type ( )
pure virtual

Create and return a new DynamicTypeBuilder object representing a union type.

This is a convenience routine, in place of calling DynamicTypeBuilder::create_type() directly. The union type of the result returned shall initially contain no members.

Return values
nilIn the case of an error
virtual class DynamicTypeBuilder* DDS::DynamicTypeBuilderFactory::create_wstring_type ( const unsigned int  bound)
pure virtual

Create and return a new DynamicTypeBuilder object representing a string type.

The element type of the result returned by this operation is Char32.

All string types having equal element types and equal bounds shall be considered equal.

The maximum number of elements that may be stored in a string of the new type is specified by parameter 'bound'. If this argument is equal to LENGTH_UNLIMITED, the string type shall be unbounded.

Return values
nilIf an error occurs
static ReturnCode_t DDS::DynamicTypeBuilderFactory::delete_instance ( )
static

Reclaim any resources associated with the instance returned from DynamicTypeBuilderFactory::get_instance.

Return values
RETCODE_OKon success
RETCODE_ERRORif it fails
virtual ReturnCode_t DDS::DynamicTypeBuilderFactory::delete_type ( class DynamicType type)
pure virtual

Destroy a DynamicType instance obtained through the DynamicTypeBuilderFactory::get_primitive_type operation.

Return values
RETCODE_OKon success
RETCODE_ALREADY_DELETEDif the type has previously been deleted and the middlware can detect that fact
RETCODE_ERRORon any other error
virtual ReturnCode_t DDS::DynamicTypeBuilderFactory::delete_type_builder ( class DynamicTypeBuilder dtb)
pure virtual

Destroy a DynamicTypeBuilder instance obtained through one of the create methods on the DynamicTypeBuilderFactory.

Return values
RETCODE_OKon success
RETCODE_ERRORon any other error
static DynamicTypeBuilderFactory* DDS::DynamicTypeBuilderFactory::get_instance ( )
static

Return the DDS_DynamicTypeBuilderFactory singleton instance.

Calling this operation is legal even after DynamicTypeBuilderFactory::delete_instance has been called.

In such a case, the implementation will recreate or restore the state of the "singleton" as necessary in order to return a valid object to the caller.

If an error occurs, this method shall return a nil value.

virtual class DynamicType* DDS::DynamicTypeBuilderFactory::get_primitive_type ( const TypeKind  kind)
pure virtual

Retrieve a DynamicType object corresponding to the indicated primitive type kind.

The kind of the primitive type whose representation is to be returned is specified by parameter 'kind'.

Return values
nilif the given kind does not correspond to a primitive type

© 2009-2017 Twin Oaks Computing, Inc
Castle Rock, CO 80108
All rights reserved.