Class TypeObjectFactory

Class Documentation

class TypeObjectFactory

Public Functions

~TypeObjectFactory()
RTPS_DllAPI const TypeInformation * get_type_information (const std::string &type_name) const

get_type_information Retrieves the TypeInformation of the named type.

Parameters:

type_name

Returns:

RTPS_DllAPI TypeInformation * get_type_information (const TypeIdentifier *identifier) const

get_type_information Retrieves the TypeInformation of the given TypeIdentifier.

Parameters:

identifier

Returns:

RTPS_DllAPI const TypeObject * get_type_object (const std::string &type_name, bool complete=false) const
RTPS_DllAPI const TypeObject * get_type_object (const TypeIdentifier *identifier) const
RTPS_DllAPI TypeKind get_type_kind (const std::string &type_name) const
RTPS_DllAPI std::string get_type_name (const TypeKind kind) const
RTPS_DllAPI std::string get_type_name (const TypeIdentifier *identifier) const
RTPS_DllAPI const TypeIdentifier * get_primitive_type_identifier (TypeKind kind) const
RTPS_DllAPI const TypeIdentifier * get_type_identifier (const std::string &type_name, bool complete=false) const
RTPS_DllAPI const TypeIdentifier * get_type_identifier_trying_complete (const std::string &type_name) const
RTPS_DllAPI const TypeIdentifier * get_string_identifier (uint32_t bound, bool wide=false)
RTPS_DllAPI const TypeIdentifier * get_sequence_identifier (const std::string &type_name, uint32_t bound, bool complete=false)
RTPS_DllAPI const TypeIdentifier * get_array_identifier (const std::string &type_name, const std::vector< uint32_t > &bound, bool complete=false)
RTPS_DllAPI const TypeIdentifier * get_map_identifier (const std::string &key_type_name, const std::string &value_type_name, uint32_t bound, bool complete=false)
RTPS_DllAPI DynamicType_ptr build_dynamic_type (const std::string &name, const TypeIdentifier *identifier, const TypeObject *object=nullptr) const
RTPS_DllAPI bool is_type_identifier_complete (const TypeIdentifier *identifier) const
RTPS_DllAPI void add_type_identifier (const std::string &type_name, const TypeIdentifier *identifier)
RTPS_DllAPI void add_type_object (const std::string &type_name, const TypeIdentifier *identifier, const TypeObject *object)
inline RTPS_DllAPI void add_alias (const std::string &alias_name, const std::string &target_type)
RTPS_DllAPI TypeIdentifierWithSizeSeq typelookup_get_type_dependencies (const TypeIdentifierSeq &identifiers, const OctetSeq &in_continuation_point, OctetSeq &out_continuation_point, size_t max_size) const

Returns a TypeIdentifierWithSizeSeq object filled with the dependencies of the given identifiers. If continuation_point isn’t empty, then it will skip the first (max_size * continuation_point) dependencies.

Parameters:
  • identifiers

  • in_continuation_point

  • out_continuation_point

  • max_size

Returns:

RTPS_DllAPI const TypeIdentifier * typelookup_get_type (const TypeIdentifier &identifier, TypeObject &object) const

Fills the given object with the complete version of the given identifier. If the given identifier was MINIMAL, then it will return the stored COMPLETE identifier pointer. Otherwise, it will return the given identifier address (to make comparision trivial).

Parameters:
  • identifier

  • object

Returns:

RTPS_DllAPI bool typelookup_check_type_identifier (const TypeIdentifier &identifier) const

Checks if a TypeIdentifier is already known by the factory.

Parameters:

identifier

Returns:

RTPS_DllAPI const TypeObject * typelookup_get_type_object_from_information (const TypeInformation &information) const

Retrieves the CompleteTypeObject from the given TypeInformation. If it doesn’t exist, it returns nullptr. A user that received a TypeInformation from TypeLookupService that calls this method and returns nullptr, must iterate through the TypeInformation dependencies calling recursively to getTypeDependencies method in its participant (which will call the correspondent method in the TypeLookupService), retrieving the TypeObject correspondent and registering the type into the Factory with a name using the add_type_object method, for each COMPLETE TypeIdentifier received in this way until all the hierarchy is registered, and then, the user may call again this method that should return the TypeObject.

Parameters:

information

Returns:

Public Static Functions

static RTPS_DllAPI TypeObjectFactory * get_instance ()
static RTPS_DllAPI ReturnCode_t delete_instance ()

Protected Functions

TypeObjectFactory()
DynamicType_ptr build_dynamic_type(TypeDescriptor &descriptor, const TypeObject *object, const DynamicType_ptr annotation_member_type = DynamicType_ptr(nullptr)) const
const TypeIdentifier *try_get_complete(const TypeIdentifier *identifier) const
const TypeIdentifier *get_stored_type_identifier(const TypeIdentifier *identifier) const
std::string generate_name_and_store_type_identifier(const TypeIdentifier *identifier) const
void nullify_all_entries(const TypeIdentifier *identifier)
void create_builtin_annotations()
void apply_type_annotations(DynamicTypeBuilder_ptr &type_builder, const AppliedAnnotationSeq &annotations) const
void apply_member_annotations(DynamicTypeBuilder_ptr &parent_type_builder, MemberId member_id, const AppliedAnnotationSeq &annotations) const
std::string get_key_from_hash(const DynamicType_ptr annotation_descriptor_type, const NameHash &hash) const
void fill_minimal_information(TypeInformation *info, const TypeIdentifier *ident) const

Fills the TypeInformation provided with the minimal TypeIdentifiers and its minimal dependencies.

Parameters:
  • info

  • ident

void fill_complete_information(TypeInformation *info, const TypeIdentifier *ident) const

Fills the TypeInformation provided with the complete TypeIdentifiers and its complete dependencies if possible, or minimal ones in other case.

Parameters:
  • info

  • ident

void fill_minimal_dependant_types(TypeInformation *info, const TypeIdentifier *identifier) const

Auxiliar function to fill minimal dependencies.

Parameters:
  • info

  • identifier

void fill_complete_dependant_types(TypeInformation *info, const TypeIdentifier *identifier) const

Auxiliar function to fill complete dependencies.

Parameters:
  • info

  • identifier

void fill_complete_minimal_dependant_types(TypeInformation *info, const TypeIdentifier *identifier) const

Auxiliar function to fill minimal information with complete dependencies.

Parameters:
  • info

  • identifier

Protected Attributes

mutable std::map<const std::string, const TypeIdentifier*> identifiers_
std::map<const std::string, const TypeIdentifier*> complete_identifiers_
std::map<const TypeIdentifier*, const TypeObject*> objects_
std::map<const TypeIdentifier*, const TypeObject*> complete_objects_
mutable std::vector<TypeIdentifier*> identifiers_created_
mutable std::map<const TypeIdentifier*, TypeInformation*> informations_
mutable std::vector<TypeInformation*> informations_created_
std::map<std::string, std::string> aliases_