19.1.6.1.7. DynamicTypeBuilderFactory

class DynamicTypeBuilderFactory : public std::enable_shared_from_this<DynamicTypeBuilderFactory>

Public Functions

virtual traits<DynamicType>::ref_type get_primitive_type(TypeKind kind) = 0

Retrieves the cached DynamicType reference associated to a given primitive.

Parameters:

kind[in] Type identifying the primitive type to retrieve.

Returns:

DynamicType reference. Nil reference returned in error case.

virtual traits<DynamicTypeBuilder>::ref_type create_type(traits<TypeDescriptor>::ref_type descriptor) = 0

Creates a new DynamicTypeBuilder reference based on the given TypeDescriptor state.

Parameters:

descriptor[in] TypeDescriptor to be copied.

Returns:

New DynamicTypeBuilder reference. Nil reference returned in error case.

virtual traits<DynamicTypeBuilder>::ref_type create_type_copy(traits<DynamicType>::ref_type type) = 0

Creates a new DynamicTypeBuilder reference based on the given DynamicType reference.

Parameters:

type[in] DynamicType reference to be used.

Returns:

New DynamicTypeBuilder reference. Nil reference returned in error case.

virtual traits<DynamicTypeBuilder>::ref_type create_type_w_type_object(const xtypes::TypeObject &type_object) = 0

Creates a new DynamicTypeBuilder reference based on the given xtypes::TypeObject instance.

Parameters:

type_object[in] xtypes::TypeObject instance to be used.

Returns:

New DynamicTypeBuilder reference. Nil reference returned in error case.

virtual traits<DynamicTypeBuilder>::ref_type create_string_type(uint32_t bound) = 0

Creates a new DynamicTypeBuilder reference representing a bounded string type.

Parameters:

bound[in] uint32_t representing the maximum number of elements that may be stored. If the value is equal to LENGTH_UNLIMITED, the string type shall be considered to be unbounded.

Returns:

new DynamicTypeBuilder reference.

virtual traits<DynamicTypeBuilder>::ref_type create_wstring_type(uint32_t bound) = 0

Creates a new DynamicTypeBuilder reference representing a bounded wstring type.

Parameters:

bound[in] uint32_t representing the maximum number of elements that may be stored. If the value is equal to LENGTH_UNLIMITED, the wstring type shall be considered to be unbounded.

Returns:

new DynamicTypeBuilder reference.

virtual traits<DynamicTypeBuilder>::ref_type create_sequence_type(traits<DynamicType>::ref_type element_type, uint32_t bound) = 0

Creates a new DynamicTypeBuilder reference representing a sequence.

Parameters:
  • element_type[in] DynamicType reference which becomes the element type

  • bound[in] uint32_t representing the maximum number of elements that may be stored. If the value is equal to LENGTH_UNLIMITED, the sequence type shall be considered to be unbounded.

Returns:

new DynamicTypeBuilder reference. Nil reference returned in error case.

virtual traits<DynamicTypeBuilder>::ref_type create_array_type(traits<DynamicType>::ref_type element_type, const BoundSeq &bound) = 0

Creates a new DynamicTypeBuilder reference representing an array.

Parameters:
  • element_type[in] DynamicType reference which becomes the element type

  • bound[in] uint32_t sequence representing the desired dimensions.

Returns:

new DynamicTypeBuilder reference. Nil reference returned in error case.

virtual traits<DynamicTypeBuilder>::ref_type create_map_type(traits<DynamicType>::ref_type key_element_type, traits<DynamicType>::ref_type element_type, uint32_t bound) = 0

Creates a new DynamicTypeBuilder reference representing a map.

Parameters:
  • key_element_type[in] DynamicType reference which becomes the map’s key type

  • element_type[in] DynamicType reference which becomes the map’s value type

  • bound[in] uint32_t representing the maximum number of elements that may be stored. If the value is equal to LENGTH_UNLIMITED, the map type shall be considered to be unbounded.

Returns:

new DynamicTypeBuilder reference. Nil reference returned in error case.

virtual traits<DynamicTypeBuilder>::ref_type create_bitmask_type(uint32_t bound) = 0

Creates a new DynamicTypeBuilder reference representing a bitmask.

Parameters:

bound[in] uint32_t representing the maximum number of elements that may be stored.

Returns:

new DynamicTypeBuilder reference. Nil reference returned in error case.

virtual traits<DynamicTypeBuilder>::ref_type create_type_w_uri(const std::string &document_url, const std::string &type_name, const IncludePathSeq &include_paths) = 0

Creates a new DynamicTypeBuilder reference by parsing the type description at the given URL.

Remark

Not implemented yet.

Parameters:
  • document_url[in] pointing to the url containing the type description.

  • type_name[in] Fully qualified name of the type to be loaded from the document.

  • include_paths[in] A collection of URLs to directories to be searched for additional type description documents.

Returns:

new DynamicTypeBuilder reference. Nil reference returned in error case.

virtual traits<DynamicTypeBuilder>::ref_type create_type_w_document(const std::string &document, const std::string &type_name, const IncludePathSeq &include_paths) = 0

Creates a new DynamicTypeBuilder reference by parsing the type description contained in the given string.

Remark

Not implemented yet.

Parameters:
  • document[in] containing the type description.

  • type_name[in] Fully qualified name of the type to be loaded from the string.

  • include_paths[in] A collection of URLs to directories to be searched for additional type description documents.

Returns:

new DynamicTypeBuilder reference. Nil reference returned in error case.

virtual ReturnCode_t delete_type(traits<DynamicType>::ref_type &type) = 0

Resets the internal reference if it is cached.

Parameters:

type[in] DynamicType reference whose internal cached reference to reset.

Return values:

RETCODE_OK – is always returned.

Returns:

standard ReturnCode_t

Public Static Functions

static traits<DynamicTypeBuilderFactory>::ref_type get_instance()

Returns the singleton factory object.

Remark

This method is non thread-safe.

Returns:

DynamicTypeBuilderFactory reference.

static ReturnCode_t delete_instance()

Resets the singleton reference.

Return values:
  • RETCODE_BAD_PARAMETER – if singleton reference is currently nil.

  • RETCODE_OK – otherwise.

Returns:

ReturnCode_t