Add a setup function which takes the topic name from the descriptors typename

This commit is contained in:
Erik Hofman
2021-03-15 15:16:28 +01:00
parent 76cf1e01c6
commit 931a696007
2 changed files with 14 additions and 1 deletions

View File

@@ -53,6 +53,14 @@ SG_DDS::setup( const char *topic, const dds_topic_descriptor_t *desc, const size
packet_size = size;
}
void
SG_DDS::setup(const dds_topic_descriptor_t *desc, const size_t size)
{
topic_name = desc->m_typename;
descriptor = desc;
packet_size = size;
}
// If specified as a server (in direction) create a subscriber.
// If specified as a client (out direction), create a publisher.
bool

View File

@@ -60,7 +60,12 @@ public:
/** Destructor */
~SG_DDS();
// Set the paramaters which weren't available at creation time.
// Set the paramaters which weren't available at creation time and use
// the descrtors typename as topic name.
void setup(const dds_topic_descriptor_t *desc, size_t size);
// Set the paramaters which weren't available at creation time and use
// a custom topic name.
void setup(const char* topic, const dds_topic_descriptor_t *desc, size_t size);
// If specified as a server start a publishing participant.