Add a helper function which converts the template typename into a topic name.
This commit is contained in:
parent
5e837b50c4
commit
8e97b5e414
@ -35,6 +35,7 @@
|
|||||||
#include <simgear/compiler.h>
|
#include <simgear/compiler.h>
|
||||||
#include <simgear/math/sg_types.hxx>
|
#include <simgear/math/sg_types.hxx>
|
||||||
#include <simgear/io/iochannel.hxx>
|
#include <simgear/io/iochannel.hxx>
|
||||||
|
#include <simgear/structure/intern.hxx>
|
||||||
|
|
||||||
#define FG_DDS_DOMAIN DDS_DOMAIN_DEFAULT
|
#define FG_DDS_DOMAIN DDS_DOMAIN_DEFAULT
|
||||||
|
|
||||||
@ -67,6 +68,12 @@ public:
|
|||||||
// a custom topic name.
|
// a custom topic name.
|
||||||
void setup(const char* topic, const dds_topic_descriptor_t *desc, size_t size);
|
void setup(const char* topic, const dds_topic_descriptor_t *desc, size_t size);
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void setup(const dds_topic_descriptor_t *desc) {
|
||||||
|
std::string type = simgear::getTypeName<T>();
|
||||||
|
setup(type.c_str(), desc, sizeof(T));
|
||||||
|
}
|
||||||
|
|
||||||
// If specified as a server start a publishing participant.
|
// If specified as a server start a publishing participant.
|
||||||
// If specified as a client start a subscribing participant.
|
// If specified as a client start a subscribing participant.
|
||||||
bool open(const SGProtocolDir d);
|
bool open(const SGProtocolDir d);
|
||||||
|
Loading…
Reference in New Issue
Block a user