From 17c79caea30eb5edd6d4fd23cddc01976118049f Mon Sep 17 00:00:00 2001 From: Erik Hofman Date: Sun, 28 Mar 2021 08:57:37 +0200 Subject: [PATCH] Add a convenience constructor which uses the types typename to call setup, eliminating the need to call setup separately. --- simgear/io/SGDataDistributionService.hxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/simgear/io/SGDataDistributionService.hxx b/simgear/io/SGDataDistributionService.hxx index a135ef6a..a2d9fc72 100644 --- a/simgear/io/SGDataDistributionService.hxx +++ b/simgear/io/SGDataDistributionService.hxx @@ -61,6 +61,11 @@ public: SG_DDS_Topic(const char* topic, const dds_topic_descriptor_t *desc, size_t size); + template + SG_DDS_Topic(T& type, const dds_topic_descriptor_t *desc) : SG_DDS_Topic() { + setup(desc); + } + /** Destructor */ ~SG_DDS_Topic();