diff --git a/agiros-loong-travodds-cpp_1.1.0.orig.tar.gz b/agiros-loong-travodds-cpp_1.1.0.orig.tar.gz index e0d9bf5484931ba65da0b4451d341062e4b6d9e3..74a150d760e770d4e249bdc3653f383790c56ec4 100644 Binary files a/agiros-loong-travodds-cpp_1.1.0.orig.tar.gz and b/agiros-loong-travodds-cpp_1.1.0.orig.tar.gz differ diff --git a/debian/gbp.conf b/debian/gbp.conf index 93578ecec3870b5cb260da46e62c39fe2723c5a2..e3d01ba11e3dba0f86f883f9640521caaefbc084 100644 --- a/debian/gbp.conf +++ b/debian/gbp.conf @@ -1,3 +1,3 @@ [git-buildpackage] -upstream-tag=release/loong/travodds_cpp/1.1.0 +upstream-tag=release/loong/travodds_cpp/1.0.0 upstream-tree=tag diff --git a/include/dds_cpp_domain.h b/include/dds_cpp_domain.h index 142152a80cc27fdb3d12cd6a03337395ae06948a..c21319c533fc331e6269ef1941b0ec1a0c1938cf 100644 --- a/include/dds_cpp_domain.h +++ b/include/dds_cpp_domain.h @@ -13,6 +13,7 @@ #ifndef DDS_CPP_DOMAIN_H #define DDS_CPP_DOMAIN_H +#include #include "dcps/domain/domainparticipantfactory.h" #include "dds_cpp_infrastructure.h" #include "dds_cpp_publisher.h" @@ -96,6 +97,9 @@ public: } virtual ReturnCode_t delete_publisher(Publisher *pPublisher) { + if (pPublisher == nullptr) { + return ReturnCode_t::RETCODE_BAD_PARAMETER; + } TRAVODDS::Publisher *publisher = pPublisher->getValue(); TRAVODDS::ReturnCode_t ret = value_->delete_publisher(publisher); if (ret != TRAVODDS::RETCODE_OK) { @@ -120,6 +124,9 @@ public: } virtual ReturnCode_t delete_subscriber(Subscriber *pSubscriber) { + if (pSubscriber == nullptr) { + return ReturnCode_t::RETCODE_BAD_PARAMETER; + } TRAVODDS::Subscriber *subscriber = pSubscriber->getValue(); TRAVODDS::ReturnCode_t ret = value_->delete_subscriber(subscriber); if (ret != TRAVODDS::RETCODE_OK) { @@ -151,6 +158,9 @@ public: } virtual ReturnCode_t delete_topic(Topic *pTopic) { + if (pTopic == nullptr) { + return ReturnCode_t::RETCODE_BAD_PARAMETER; + } TRAVODDS::Topic *topic = pTopic->getValue(); TRAVODDS::ReturnCode_t ret = value_->delete_topic(topic); if (ret != TRAVODDS::RETCODE_OK) { @@ -166,12 +176,15 @@ public: Topic *pRelatedTopic, const std::string &filterExpression, const std::vector &expressionParameters) { - // TODO expressionParameters + TRAVODDS::StringSeq params; + for (const auto& param : expressionParameters) { + params.push_back(param); + } TRAVODDS::ContentFilteredTopic *contentFilteredTopic = value_->create_contentfilteredtopic( name, pRelatedTopic->getValue(), filterExpression, - TRAVODDS::StringSeq()); + params); if (contentFilteredTopic == nullptr) { return nullptr; } @@ -180,6 +193,9 @@ public: } virtual ReturnCode_t delete_contentfilteredtopic(ContentFilteredTopic *pContentFilteredTopic) { + if (pContentFilteredTopic == nullptr) { + return ReturnCode_t::RETCODE_BAD_PARAMETER; + } TRAVODDS::ContentFilteredTopic *contentFilteredTopic = pContentFilteredTopic->getValue(); TRAVODDS::ReturnCode_t ret = value_->delete_contentfilteredtopic(contentFilteredTopic); if (ret != TRAVODDS::RETCODE_OK) { @@ -209,6 +225,9 @@ public: } virtual ReturnCode_t delete_multitopic(MultiTopic *pMultiTopic) { + if (pMultiTopic == nullptr) { + return ReturnCode_t::RETCODE_BAD_PARAMETER; + } TRAVODDS::MultiTopic *multiTopic = pMultiTopic->getValue(); TRAVODDS::ReturnCode_t ret = value_->delete_multitopic(multiTopic); if (ret != TRAVODDS::RETCODE_OK) { diff --git a/include/dds_cpp_topic.h b/include/dds_cpp_topic.h index 8f826fc3746cb21dc979d4df21b98188e3c48fb1..5c7df06c69940723261e9d5c5eec360f30e056da 100644 --- a/include/dds_cpp_topic.h +++ b/include/dds_cpp_topic.h @@ -25,6 +25,7 @@ class DCPSDLL TopicDescription { friend class Topic; friend class Subscriber; friend class DataReader; + friend class ContentFilteredTopic; private: TRAVODDS::TopicDescription *value_; TopicDescription(TRAVODDS::TopicDescription *topicDescription) : value_(topicDescription) {} @@ -47,6 +48,7 @@ class DCPSDLL Topic { friend class Subscriber; friend class DataWriter; friend class DataReader; + friend class ContentFilteredTopic; private: TRAVODDS::Topic *value_; Topic(TRAVODDS::Topic *topic) : value_(topic) {} @@ -120,6 +122,43 @@ private: TRAVODDS::ContentFilteredTopic *value_; ContentFilteredTopic(TRAVODDS::ContentFilteredTopic *contentFilteredTopic) : value_(contentFilteredTopic) {} TRAVODDS::ContentFilteredTopic *getValue() { return value_; } + +public: + Topic* get_related_topic() { + TRAVODDS::Topic* topic = value_->get_related_topic(); + if (topic == nullptr) { + return nullptr; + } + return new Topic(topic); + } + + const std::string& get_filter_expression() { + return value_->get_filter_expression(); + } + + std::vector get_expression_parameters() { + TRAVODDS::StringSeq params; + value_->get_expression_parameters(params); + std::vector result; + for (size_t i = 0; i < params.size(); i++) { + result.push_back(params[i]); + } + return result; + } + + ReturnCode_t set_expression_parameters(const std::vector& params) { + TRAVODDS::StringSeq travoddsParams; + for (const auto& param : params) { + travoddsParams.push_back(param); + } + TRAVODDS::ReturnCode_t ret = value_->set_expression_parameters(travoddsParams); + return DDSCppWrapper::from(ret); + } + + TopicDescription* as_topic_description() { + TRAVODDS::TopicDescription* desc = dynamic_cast(value_); + return new TopicDescription(desc); + } }; class DCPSDLL MultiTopic {