Fast RTPS  Version 2.14.1
Fast RTPS
Loading...
Searching...
No Matches
TypeObjectFactory Class Reference

#include <TypeObjectFactory.h>

Public Member Functions

 ~TypeObjectFactory ()
 
RTPS_DllAPI const TypeInformationget_type_information (const std::string &type_name) const
 get_type_information Retrieves the TypeInformation of the named type.
 
RTPS_DllAPI TypeInformationget_type_information (const TypeIdentifier *identifier) const
 get_type_information Retrieves the TypeInformation of the given TypeIdentifier.
 
RTPS_DllAPI const TypeObjectget_type_object (const std::string &type_name, bool complete=false) const
 
RTPS_DllAPI const TypeObjectget_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 TypeIdentifierget_primitive_type_identifier (TypeKind kind) const
 
RTPS_DllAPI const TypeIdentifierget_type_identifier (const std::string &type_name, bool complete=false) const
 
RTPS_DllAPI const TypeIdentifierget_type_identifier_trying_complete (const std::string &type_name) const
 
RTPS_DllAPI const TypeIdentifierget_string_identifier (uint32_t bound, bool wide=false)
 
RTPS_DllAPI const TypeIdentifierget_sequence_identifier (const std::string &type_name, uint32_t bound, bool complete=false)
 
RTPS_DllAPI const TypeIdentifierget_array_identifier (const std::string &type_name, const std::vector< uint32_t > &bound, bool complete=false)
 
RTPS_DllAPI const TypeIdentifierget_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)
 
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.
 
RTPS_DllAPI const TypeIdentifiertypelookup_get_type (const TypeIdentifier &identifier, TypeObject &object) const
 Fills the given object with the complete version of the given identifier.
 
RTPS_DllAPI bool typelookup_check_type_identifier (const TypeIdentifier &identifier) const
 Checks if a TypeIdentifier is already known by the factory.
 
RTPS_DllAPI const TypeObjecttypelookup_get_type_object_from_information (const TypeInformation &information) const
 Retrieves the CompleteTypeObject from the given TypeInformation.
 

Static Public Member Functions

static RTPS_DllAPI TypeObjectFactoryget_instance ()
 
static RTPS_DllAPI ReturnCode_t delete_instance ()
 

Protected Member Functions

 TypeObjectFactory ()
 
DynamicType_ptr build_dynamic_type (TypeDescriptor &descriptor, const TypeObject *object, const DynamicType_ptr annotation_member_type=DynamicType_ptr(nullptr)) const
 
const TypeIdentifiertry_get_complete (const TypeIdentifier *identifier) const
 
const TypeIdentifierget_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.
 
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.
 
void fill_minimal_dependant_types (TypeInformation *info, const TypeIdentifier *identifier) const
 Auxiliar function to fill minimal dependencies.
 
void fill_complete_dependant_types (TypeInformation *info, const TypeIdentifier *identifier) const
 Auxiliar function to fill complete dependencies.
 
void fill_complete_minimal_dependant_types (TypeInformation *info, const TypeIdentifier *identifier) const
 Auxiliar function to fill minimal information with complete dependencies.
 

Protected Attributes

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_
 
std::vector< TypeIdentifier * > identifiers_created_
 
std::map< const TypeIdentifier *, TypeInformation * > informations_
 
std::vector< TypeInformation * > informations_created_
 
std::map< std::string, std::string > aliases_
 

Constructor & Destructor Documentation

◆ TypeObjectFactory()

TypeObjectFactory ( )
protected

◆ ~TypeObjectFactory()

Member Function Documentation

◆ add_alias()

RTPS_DllAPI void add_alias ( const std::string &  alias_name,
const std::string &  target_type 
)
inline

◆ add_type_identifier()

RTPS_DllAPI void add_type_identifier ( const std::string &  type_name,
const TypeIdentifier identifier 
)

◆ add_type_object()

RTPS_DllAPI void add_type_object ( const std::string &  type_name,
const TypeIdentifier identifier,
const TypeObject object 
)

◆ apply_member_annotations()

void apply_member_annotations ( DynamicTypeBuilder_ptr parent_type_builder,
MemberId  member_id,
const AppliedAnnotationSeq annotations 
) const
protected

◆ apply_type_annotations()

void apply_type_annotations ( DynamicTypeBuilder_ptr type_builder,
const AppliedAnnotationSeq annotations 
) const
protected

◆ build_dynamic_type() [1/2]

RTPS_DllAPI DynamicType_ptr build_dynamic_type ( const std::string &  name,
const TypeIdentifier identifier,
const TypeObject object = nullptr 
) const

◆ build_dynamic_type() [2/2]

DynamicType_ptr build_dynamic_type ( TypeDescriptor descriptor,
const TypeObject object,
const DynamicType_ptr  annotation_member_type = DynamicType_ptr(nullptr) 
) const
protected

◆ create_builtin_annotations()

void create_builtin_annotations ( )
protected

◆ delete_instance()

static RTPS_DllAPI ReturnCode_t delete_instance ( )
static

◆ fill_complete_dependant_types()

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

Auxiliar function to fill complete dependencies.

Parameters
info
identifier

◆ fill_complete_information()

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

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

Parameters
info
ident

◆ fill_complete_minimal_dependant_types()

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

Auxiliar function to fill minimal information with complete dependencies.

Parameters
info
identifier

◆ fill_minimal_dependant_types()

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

Auxiliar function to fill minimal dependencies.

Parameters
info
identifier

◆ fill_minimal_information()

void fill_minimal_information ( TypeInformation info,
const TypeIdentifier ident 
) const
protected

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

Parameters
info
ident

◆ generate_name_and_store_type_identifier()

std::string generate_name_and_store_type_identifier ( const TypeIdentifier identifier) const
protected

◆ get_array_identifier()

RTPS_DllAPI const TypeIdentifier * get_array_identifier ( const std::string &  type_name,
const std::vector< uint32_t > &  bound,
bool  complete = false 
)

◆ get_instance()

static RTPS_DllAPI TypeObjectFactory * get_instance ( )
static

◆ get_key_from_hash()

std::string get_key_from_hash ( const DynamicType_ptr  annotation_descriptor_type,
const NameHash hash 
) const
protected

◆ get_map_identifier()

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 
)

◆ get_primitive_type_identifier()

RTPS_DllAPI const TypeIdentifier * get_primitive_type_identifier ( TypeKind  kind) const

◆ get_sequence_identifier()

RTPS_DllAPI const TypeIdentifier * get_sequence_identifier ( const std::string &  type_name,
uint32_t  bound,
bool  complete = false 
)

◆ get_stored_type_identifier()

const TypeIdentifier * get_stored_type_identifier ( const TypeIdentifier identifier) const
protected

◆ get_string_identifier()

RTPS_DllAPI const TypeIdentifier * get_string_identifier ( uint32_t  bound,
bool  wide = false 
)

◆ get_type_identifier()

RTPS_DllAPI const TypeIdentifier * get_type_identifier ( const std::string &  type_name,
bool  complete = false 
) const

◆ get_type_identifier_trying_complete()

RTPS_DllAPI const TypeIdentifier * get_type_identifier_trying_complete ( const std::string &  type_name) const

◆ get_type_information() [1/2]

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

◆ get_type_information() [2/2]

RTPS_DllAPI TypeInformation * get_type_information ( const TypeIdentifier identifier) const

get_type_information Retrieves the TypeInformation of the given TypeIdentifier.

Parameters
identifier
Returns

◆ get_type_kind()

RTPS_DllAPI TypeKind get_type_kind ( const std::string &  type_name) const

◆ get_type_name() [1/2]

RTPS_DllAPI std::string get_type_name ( const TypeIdentifier identifier) const

◆ get_type_name() [2/2]

RTPS_DllAPI std::string get_type_name ( const TypeKind  kind) const

◆ get_type_object() [1/2]

RTPS_DllAPI const TypeObject * get_type_object ( const std::string &  type_name,
bool  complete = false 
) const

◆ get_type_object() [2/2]

RTPS_DllAPI const TypeObject * get_type_object ( const TypeIdentifier identifier) const

◆ is_type_identifier_complete()

RTPS_DllAPI bool is_type_identifier_complete ( const TypeIdentifier identifier) const

◆ nullify_all_entries()

void nullify_all_entries ( const TypeIdentifier identifier)
protected

◆ try_get_complete()

const TypeIdentifier * try_get_complete ( const TypeIdentifier identifier) const
protected

◆ typelookup_check_type_identifier()

RTPS_DllAPI bool typelookup_check_type_identifier ( const TypeIdentifier identifier) const

Checks if a TypeIdentifier is already known by the factory.

Parameters
identifier
Returns

◆ typelookup_get_type()

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

◆ typelookup_get_type_dependencies()

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

◆ typelookup_get_type_object_from_information()

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

Member Data Documentation

◆ aliases_

std::map<std::string, std::string> aliases_
protected

◆ complete_identifiers_

std::map<const std::string, const TypeIdentifier*> complete_identifiers_
protected

◆ complete_objects_

std::map<const TypeIdentifier*, const TypeObject*> complete_objects_
protected

◆ identifiers_

std::map<const std::string, const TypeIdentifier*> identifiers_
mutableprotected

◆ identifiers_created_

std::vector<TypeIdentifier*> identifiers_created_
mutableprotected

◆ informations_

std::map<const TypeIdentifier*, TypeInformation*> informations_
mutableprotected

◆ informations_created_

std::vector<TypeInformation*> informations_created_
mutableprotected

◆ objects_

std::map<const TypeIdentifier*, const TypeObject*> objects_
protected

The documentation for this class was generated from the following file: