From 13a7eeef74524fe286a9a4aa26b103fc035f8307 Mon Sep 17 00:00:00 2001 From: Erik Hofman Date: Sun, 28 Mar 2021 09:00:15 +0200 Subject: [PATCH] Use the new convenience constructor eliminating the need to call setup separately. --- src/Network/DDS/fg_dds_log.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/Network/DDS/fg_dds_log.cpp b/src/Network/DDS/fg_dds_log.cpp index a799d5946..e0b9ebc09 100644 --- a/src/Network/DDS/fg_dds_log.cpp +++ b/src/Network/DDS/fg_dds_log.cpp @@ -67,25 +67,21 @@ int main() SG_DDS participant; std::map topics; - topics["gui"] = new SG_DDS_Topic(); - topics["fdm"] = new SG_DDS_Topic(); - topics["ctrls"] = new SG_DDS_Topic(); - - topics["gui"]->setup(&FG_DDS_GUI_desc); - topics["fdm"]->setup(&FG_DDS_FDM_desc); - topics["ctrls"]->setup(&FG_DDS_Ctrls_desc); - + FG_DDS_GUI gui; + topics["gui"] = new SG_DDS_Topic(gui, &FG_DDS_GUI_desc); participant.add(topics["gui"], SG_IO_IN); + + FG_DDS_FDM fdm; + topics["fdm"] = new SG_DDS_Topic(fdm, &FG_DDS_FDM_desc); participant.add(topics["fdm"], SG_IO_IN); + + FG_DDS_Ctrls ctrls; + topics["ctrls"] = new SG_DDS_Topic(ctrls, &FG_DDS_Ctrls_desc); participant.add(topics["ctrls"], SG_IO_IN); set_mode(1); while(participant.wait(0.1f)) { - FG_DDS_Ctrls ctrls; - FG_DDS_FDM fdm; - FG_DDS_GUI gui; - if (topics["gui"]->read(gui)) { printf("=== [fgfdm_log] Received : "); printf("GUI Message:\n");