#include <ddsManager.h>
Public Member Functions | |
DataReader_ptr | createReader (std::string domain_name, std::string partition_name, Topic_var topic) |
Topic_var | createTopic (std::string domain_name, const char *topic_name, const char *type_name) |
DataWriter_ptr | createWriter (std::string domain_name, std::string partition_name, Topic_var topic) |
virtual bool | lookupOrCreateParticipant (std::string domain_name) |
bool | lookupOrCreatePublisher (std::string domain_name, std::string partition_name) |
bool | lookupOrCreateSubscriber (std::string domain_name, std::string partition_name) |
bool | registerType (std::string domain_name, TypeSupport *ts) |
virtual | ~DDSManager () |
Public Attributes | |
DomainParticipantFactory_var | m_dpf |
reference to the dds DomainParticipantFactory singelton | |
std::map< std::string, DomainParticipant_var > | m_participants |
a map holding the domain names and the corresponding dds domain participants | |
std::map< std::string, std::map< std::string, Publisher_var > > | m_publishers |
a map of maps that holds the domain names, partition_names and the corresponding publishers | |
std::map< std::string, TopicQos > | m_reliable_topic_qos |
a map holding the domain names and the corresponding default topic qos in this domain | |
std::map< std::string, std::map< std::string, Subscriber_var > > | m_subscribers |
a map of maps that holds the domain names, partition_names and the corresponding subscribers | |
Private Member Functions | |
virtual bool | createParticipant (std::string domain_name) |
virtual bool | createPublisher (std::string domain_name, std::string partition_name) |
virtual bool | createSubscriber (std::string domain_name, std::string partition_name) |
DDSManager () | |
DDSManager (const DDSManager &) | |
Friends | |
class | Singleton< DDSManager > |
This class is a singleton and exists only once in each application. It creates a domain participant for each dds domain. Additionally it creates subscribes and publishers for each dds partition. You can also register types and topics using this class. Afterwards you can create data reades and writers for the registered topics and use it in your component.
Definition at line 21 of file ddsManager.h.
DDSManager::DDSManager | ( | ) | [inline, private] |
private constructor called by base singleton class.
Definition at line 31 of file ddsManager.h.
DDSManager::DDSManager | ( | const DDSManager & | ) | [inline, private] |
private constructor to prevent object creation without calling static instance function.
Definition at line 39 of file ddsManager.h.
virtual DDSManager::~DDSManager | ( | ) | [inline, virtual] |
destructer called if the application ends. clean up dds cloud
Definition at line 116 of file ddsManager.h.
virtual bool DDSManager::createParticipant | ( | std::string | domain_name | ) | [inline, private, virtual] |
private method to create a dds domain participant. Called by lookupOrCreateParticipant if no domain participant was created yet for the given domain_name and stored in m_participants
domain_name | the name to create a participant for |
Definition at line 48 of file ddsManager.h.
virtual bool DDSManager::createPublisher | ( | std::string | domain_name, |
std::string | partition_name | ||
) | [inline, private, virtual] |
private method to create a dds publisher. Called by lookupOrCreatePublisher if no publisher was created yet in the given domain_name for the given partition. The publisher is stored in m_publishers.
domain_name | the domain name in which the subscriber should be created |
partition_name | the partition for the subscriber |
Definition at line 97 of file ddsManager.h.
DataReader_ptr DDSManager::createReader | ( | std::string | domain_name, |
std::string | partition_name, | ||
Topic_var | topic | ||
) | [inline] |
This method creates a reader for the given domain, partition and topic.
the | domain_name for the reader |
the | partition of the reader |
the | topic of the reader |
Definition at line 229 of file ddsManager.h.
virtual bool DDSManager::createSubscriber | ( | std::string | domain_name, |
std::string | partition_name | ||
) | [inline, private, virtual] |
private method to create a dds subscriber. Called by lookupOrCreateSubscriber if no subscriber was created yet in the given domain_name for the given partition. The subscriber is stored in m_subscribers.
domain_name | the domain name in which the subscriber should be created |
partition_name | the partition for the subscriber |
Definition at line 74 of file ddsManager.h.
Topic_var DDSManager::createTopic | ( | std::string | domain_name, |
const char * | topic_name, | ||
const char * | type_name | ||
) | [inline] |
This method creates a topic in the given domain_name.
the | domain_name for the type |
topic_name | the name of the topic |
type_name | the name of the topic |
Definition at line 197 of file ddsManager.h.
DataWriter_ptr DDSManager::createWriter | ( | std::string | domain_name, |
std::string | partition_name, | ||
Topic_var | topic | ||
) | [inline] |
This method creates a writer for the given domain, partition and topic.
the | domain_name for the writer |
the | partition of the writer |
the | topic of the writer |
Definition at line 247 of file ddsManager.h.
virtual bool DDSManager::lookupOrCreateParticipant | ( | std::string | domain_name | ) | [inline, virtual] |
This method is called to create a domain participant. If the participant already exists no additional participant is created. This ensures that only one domain participant exists per application for each domain.
domain_name | the name of the domain |
Definition at line 125 of file ddsManager.h.
bool DDSManager::lookupOrCreatePublisher | ( | std::string | domain_name, |
std::string | partition_name | ||
) | [inline] |
This method is called to create a publisher in the given domain for the given partition. If the publisher already exists no additional publisher is created. This ensures that only one publisher exists for each domain and partition.
domain_name | the name of the subscriber domain |
partition_name | the name of the publisher partition |
Definition at line 162 of file ddsManager.h.
bool DDSManager::lookupOrCreateSubscriber | ( | std::string | domain_name, |
std::string | partition_name | ||
) | [inline] |
This method is called to create a subscriber in the given domain for the given partition. If the subscriber already exists no additional subscriber is created. This ensures that only one subscriber exists for each domain and partition.
domain_name | the name of the subscriber domain |
partition_name | the name of the subscriber partition |
Definition at line 143 of file ddsManager.h.
bool DDSManager::registerType | ( | std::string | domain_name, |
TypeSupport * | ts | ||
) | [inline] |
This method registeres the given type in the given domain.
the | domain_name for the type |
Definition at line 177 of file ddsManager.h.
friend class Singleton< DDSManager > [friend] |
Singleton class must be a friend, because only it can call protected constructor.
Definition at line 26 of file ddsManager.h.
DomainParticipantFactory_var DDSManager::m_dpf |
reference to the dds DomainParticipantFactory singelton
Definition at line 272 of file ddsManager.h.
std::map<std::string, DomainParticipant_var> DDSManager::m_participants |
a map holding the domain names and the corresponding dds domain participants
Definition at line 277 of file ddsManager.h.
std::map< std::string, std::map< std::string, Publisher_var > > DDSManager::m_publishers |
a map of maps that holds the domain names, partition_names and the corresponding publishers
Definition at line 281 of file ddsManager.h.
std::map<std::string, TopicQos> DDSManager::m_reliable_topic_qos |
a map holding the domain names and the corresponding default topic qos in this domain
Definition at line 274 of file ddsManager.h.
std::map< std::string, std::map< std::string, Subscriber_var > > DDSManager::m_subscribers |
a map of maps that holds the domain names, partition_names and the corresponding subscribers
Definition at line 279 of file ddsManager.h.