- Lts/DDS: Add BUILD_RTI guards to pacemaker.h, dds_connector.h, generic_fts_* files, generic_base.h, routing_plugin.h - Lts/Services/RoutingServiceNG: Add BUILD_RTI guards to session.h/cpp, connection.h/cpp, data_writer_task.h/cpp - Fix C++23 reference member initialization: use getLogger() instead of getNGLLogger() in constructor initializer lists - Root CMakeLists.txt: Add Lts/DDS to include_directories - Fix export header generation order (GENERATE_EXPORT_HEADER before TARGET_INCLUDE_DIRECTORIES) - Remove auto-generated stub files (external deps collected separately)
63 lines
1.3 KiB
C++
Executable File
63 lines
1.3 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Routing Test - main connection handling
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#if BUILD_RTI
|
|
|
|
#include <DDS/DDSConnector/dds_connector.h>
|
|
#include <future>
|
|
|
|
#include "logger.h"
|
|
|
|
namespace RoutingService
|
|
{
|
|
class DataWriterTask;
|
|
class TopicDispatcherInterface;
|
|
|
|
class Connection
|
|
{
|
|
public:
|
|
Connection(const dds::domain::DomainParticipant &domainParticipant,
|
|
const std::string &partition,
|
|
const std::vector<TopicDispatcherInterface *> &topicsToRoute,
|
|
const std::string &desc);
|
|
~Connection();
|
|
|
|
// only valid before initialize() !
|
|
void setOutput(Connection *output);
|
|
bool initialize();
|
|
void shutdown();
|
|
|
|
dds::domain::DomainParticipant domainParticipant() const;
|
|
dds::pub::Publisher publisher() const;
|
|
dds::sub::Subscriber subscriber() const;
|
|
|
|
private:
|
|
bool initTopics();
|
|
|
|
private:
|
|
NGL::INGLLogger &m_logger;
|
|
Connection *m_output;
|
|
dds::domain::DomainParticipant m_domainParticipant;
|
|
std::unique_ptr<DDSConnector::Publisher> m_publisher;
|
|
std::unique_ptr<DDSConnector::Subscriber> m_subscriber;
|
|
|
|
std::future<void> m_writerThread;
|
|
std::unique_ptr<DataWriterTask> m_dataWriterTask;
|
|
|
|
std::vector<TopicDispatcherInterface *> m_topicsToRoute;
|
|
|
|
std::string m_partition;
|
|
std::string m_description;
|
|
};
|
|
|
|
} // namespace RoutingService
|
|
|
|
#endif // BUILD_RTI
|