Class XMLProfileManager

Class Documentation

class XMLProfileManager

Class XMLProfileManager, used to make available profiles from XML file.

Public Static Functions

static RTPS_DllAPI void loadDefaultXMLFile ()

Load the default profiles XML file.

static RTPS_DllAPI XMLP_ret loadXMLFile (const std::string &filename)

Load a profiles XML file.

Parameters

filename – Name for the file to be loaded.

Returns

XMLP_ret::XML_OK if all profiles are correct, XMLP_ret::XML_NOK if some are and some are not, XMLP_ret::XML_ERROR in other case.

static RTPS_DllAPI XMLP_ret loadXMLString (const char *data, size_t length)

Load a profiles XML string.

Parameters
  • data – Buffer containing the data.

  • length – Length of data.

Returns

XMLP_ret::XML_OK if all profiles are correct, XMLP_ret::XML_NOK if some are and some are not, XMLP_ret::XML_ERROR in other case.

static RTPS_DllAPI XMLP_ret loadXMLNode (tinyxml2::XMLDocument &doc)

Load a profiles XML node.

Parameters

doc – Node to be loaded.

Returns

XMLP_ret::XML_OK if all profiles are correct, XMLP_ret::XML_NOK if some are and some are not, XMLP_ret::XML_ERROR in other case.

static RTPS_DllAPI XMLP_ret loadXMLProfiles (tinyxml2::XMLElement &profiles)

Load a profiles XML node.

Parameters

profiles – Node to be loaded.

Returns

XMLP_ret::XML_OK if all profiles are correct, XMLP_ret::XML_NOK if some are and some are not, XMLP_ret::XML_ERROR in other case.

static RTPS_DllAPI XMLP_ret loadXMLDynamicTypes (tinyxml2::XMLElement &types)

Load a dynamic types XML node.

Parameters

types – Node to be loaded.

Returns

XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case.

static RTPS_DllAPI void library_settings (const LibrarySettingsAttributes &library_settings)

Library settings setter.

Parameters

library_settings – New value for library settings.

static RTPS_DllAPI const LibrarySettingsAttributes & library_settings ()

Library settings getter.

Returns

const ref to current library settings.

static RTPS_DllAPI XMLP_ret fillParticipantAttributes (const std::string &profile_name, ParticipantAttributes &atts, bool log_error=true)

Search for the profile specified and fill the structure.

Parameters
  • profile_name – Name for the profile to be used to fill the structure.

  • atts – Structure to be filled.

  • log_error – Flag to log an error if the profile_name is not found.

Returns

XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. Defaults true.

static RTPS_DllAPI void getDefaultParticipantAttributes (ParticipantAttributes &participant_attributes)

Fills participant_attributes with the default values.

static RTPS_DllAPI XMLP_ret fillPublisherAttributes (const std::string &profile_name, PublisherAttributes &atts, bool log_error=true)

Search for the profile specified and fill the structure.

Parameters
  • profile_name – Name for the profile to be used to fill the structure.

  • atts – Structure to be filled.

  • log_error – Flag to log an error if the profile_name is not found.

Returns

XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. Defaults true.

static RTPS_DllAPI void getDefaultPublisherAttributes (PublisherAttributes &publisher_attributes)

Fills publisher_attributes with the default values.

static RTPS_DllAPI XMLP_ret fillSubscriberAttributes (const std::string &profile_name, SubscriberAttributes &atts, bool log_error=true)

Search for the profile specified and fill the structure.

Parameters
  • profile_name – Name for the profile to be used to fill the structure.

  • atts – Structure to be filled.

  • log_error – Flag to log an error if the profile_name is not found.

Returns

XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case. Defaults true.

static RTPS_DllAPI void getDefaultSubscriberAttributes (SubscriberAttributes &subscriber_attributes)

Fills subscriber_attributes with the default values.

static RTPS_DllAPI bool insertTransportById (const std::string &transport_id, sp_transport_t transport)

Add a new transport instance along with its id.

static RTPS_DllAPI sp_transport_t getTransportById (const std::string &transport_id)

Retrieves a transport instance by its id.

static RTPS_DllAPI XMLP_ret fillTopicAttributes (const std::string &profile_name, TopicAttributes &atts)

Search for the profile specified and fill the structure.

Parameters
  • profile_name – Name for the profile to be used to fill the structure.

  • atts – Structure to be filled.

Returns

XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case.

static RTPS_DllAPI void getDefaultTopicAttributes (TopicAttributes &topic_attributes)

Fills topic_attributes with the default values.

static RTPS_DllAPI bool insertDynamicTypeByName (const std::string &type_name, p_dynamictypebuilder_t type)

Add a new dynamic type instance along with its name.

static RTPS_DllAPI p_dynamictypebuilder_t getDynamicTypeByName (const std::string &type_name)

Retrieves a transport instance by its name.

static RTPS_DllAPI XMLP_ret fillRequesterAttributes (const std::string &profile_name, RequesterAttributes &atts)

Search for the profile specified and fill the structure.

Parameters
  • profile_name – Name for the profile to be used to fill the structure.

  • atts – Structure to be filled.

Returns

XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case.

static RTPS_DllAPI XMLP_ret fillReplierAttributes (const std::string &profile_name, ReplierAttributes &atts)

Search for the profile specified and fill the structure.

Parameters
  • profile_name – Name for the profile to be used to fill the structure.

  • atts – Structure to be filled.

Returns

XMLP_ret::XML_OK on success, XMLP_ret::XML_ERROR in other case.

static inline RTPS_DllAPI void DeleteInstance ()

Deletes the XMLProfileManager instance. FastDDS’s Domain calls this method automatically on its destructor, but if using XMLProfileManager outside of FastDDS, it should be called manually.

static inline RTPS_DllAPI types::DynamicPubSubType * CreateDynamicPubSubType (const std::string &type_name)

Retrieves a DynamicPubSubType for the given dynamic type name. Any instance retrieve by calling this method must be deleted calling the XMLProfileManager::DeleteDynamicPubSubType method.

static inline RTPS_DllAPI void DeleteDynamicPubSubType (types::DynamicPubSubType *type)

Deletes the given DynamicPubSubType previously created by calling XMLProfileManager::CreateDynamicPubSubType method.