.. _program_listing_file__tmp_ws_src_fastrtps_include_dds_core_detail_BuiltinTopicTypes.hpp: Program Listing for File BuiltinTopicTypes.hpp ============================================== |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/fastrtps/include/dds/core/detail/BuiltinTopicTypes.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /* * Copyright 2019, Proyectos y Sistemas de Mantenimiento SL (eProsima). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #ifndef EPROSIMA_DDS_CORE_DELEGATE_BUILTIN_TOPIC_TYPES_HPP_ #define EPROSIMA_DDS_CORE_DELEGATE_BUILTIN_TOPIC_TYPES_HPP_ //#include //TODO: Fix when BuiltinTopicDelegate and BuiltinTopic are implemented //#include //#include #if defined (OMG_DDS_X_TYPES_BUILTIN_TOPIC_TYPES_SUPPORT) namespace dds { namespace core { namespace detail { //TODO: Fix when BuiltinTopicDelegate and BuiltinTopic are implemented //typedef dds::core::TBytesTopicType BytesTopicType; class BytesTopicType { }; //TODO: Fix when BuiltinTopicDelegate and BuiltinTopic are implemented //typedef dds::core::TStringTopicType StringTopicType; class StringTopicType { }; //TODO: Fix when BuiltinTopicDelegate and BuiltinTopic are implemented //typedef dds::core::TKeyedBytesTopicType KeyedBytesTopicType; class KeyedBytesTopicType { }; //TODO: Fix when BuiltinTopicDelegate and BuiltinTopic are implemented //typedef dds::core::TKeyedStringTopicType KeyedStringTopicType; class KeyedStringTopicType { }; } //namespace detail //============================================================================== // Bytes Template //============================================================================== template TBytesTopicType::TBytesTopicType() : Value( std::vector()) { } template TBytesTopicType::TBytesTopicType( const std::vector& data) : dds::core::Value( data) { } template TBytesTopicType::operator std::vector&() const { return this->delegate().value(); } template const std::vector& TBytesTopicType::data() const { return this->delegate().value(); } template void TBytesTopicType::data( const std::vector& data) { this->delegate().value(data); } //============================================================================== // String Template //============================================================================== template TStringTopicType::TStringTopicType() : Value( std::string()) { } template TStringTopicType::TStringTopicType( const std::string& data) : dds::core::Value( data) { } template TStringTopicType::operator std::string& () const { return this->delegate().value(); } template const std::string& TStringTopicType::data() const { return this->delegate().value(); } template void TStringTopicType::data( const std::string& data) { this->delegate().value(data); } //============================================================================== // KeyedBytes Template //============================================================================== template TKeyedBytesTopicType::TKeyedBytesTopicType() : Value( std::string(), std::vector()) { } template TKeyedBytesTopicType::TKeyedBytesTopicType( const std::string& key, const std::vector& value) : Value( key, value) { } template const std::string& TKeyedBytesTopicType::key() const { return this->delegate().key(); } template void TKeyedBytesTopicType::key( const std::string& key) { this->delegate().key(key); } template const std::vector& TKeyedBytesTopicType::value() const { return this->delegate().value(); } template void TKeyedBytesTopicType::value( const std::vector& value) { this->delegate().value(value); } //============================================================================== // KeyedString Template //============================================================================== template TKeyedStringTopicType::TKeyedStringTopicType() : Value( std::string(), std::string()) { } template TKeyedStringTopicType::TKeyedStringTopicType( const std::string& key, const std::string& value) : Value( key, value) { } template const std::string& TKeyedStringTopicType::key() const { return this->delegate().key(); } template void TKeyedStringTopicType::key( const std::string& key) { this->delegate().key(key); } template const std::string& TKeyedStringTopicType::value() const { return this->delegate().value(); } template void TKeyedStringTopicType::value( const std::string& value) { this->delegate().value(value); } } //namespace core } //namespace dds #endif //OMG_DDS_X_TYPES_BUILTIN_TOPIC_TYPES_SUPPORT #endif //EPROSIMA_DDS_CORE_DELEGATE_BUILTIN_TOPIC_TYPES_HPP_