.. _program_listing_file__tmp_ws_src_fastrtps_include_dds_core_xtypes_Annotation.hpp: Program Listing for File Annotation.hpp ======================================= |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/fastrtps/include/dds/core/xtypes/Annotation.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /* * Copyright 2010, Object Management Group, Inc. * Copyright 2010, PrismTech, Corp. * Copyright 2010, Real-Time Innovations, Inc. * 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 OMG_DDS_CORE_XTYPES_ANNOTATION_HPP_ #define OMG_DDS_CORE_XTYPES_ANNOTATION_HPP_ #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC #include #include #include #include namespace dds { namespace core { namespace xtypes { template class TIdAnnotation; template class TAnnotation : public Reference { OMG_DDS_REF_TYPE_BASE( TAnnotation, dds::core::Reference, DELEGATE) public: virtual ~TAnnotation(); TypeKind kind() const; template class K> operator K&() { return reinterpret_cast&>(*this); } const AnnotationKind& akind() const { return impl()->akind(); } protected: TAnnotation( const TypeKind& kind); }; template class TIdAnnotation : public TAnnotation { using TAnnotation::impl; public: TIdAnnotation( uint32_t id) : TAnnotation(TypeKind::ANNOTATION_TYPE) { impl()->id(id); } uint32_t id() const { return impl()->id(); } }; template class TKeyAnnotation : public TAnnotation { using TAnnotation::impl; public: TKeyAnnotation() { } }; template class TSharedAnnotation : public TAnnotation { public: TSharedAnnotation() { } }; template class TNestedAnnotation : public TAnnotation { public: TNestedAnnotation() { } }; template class TExtensibilityAnnotation : public TAnnotation { using TAnnotation::impl; public: TExtensibilityAnnotation( ExtensibilityKind xkind) { impl()->xKind(); } ExtensibilityKind extensibility_kind() const { return impl()->xKind(); } }; template class TMustUnderstandAnnotation : public TAnnotation { public: TMustUnderstandAnnotation() { } }; template class TVerbatimAnnotation : public TAnnotation { using TAnnotation::impl; public: TVerbatimAnnotation( const std::string& text) { impl()->vbt(text); } const std::string& verbatim_text() const { return impl()->vbt(); } }; template class TBitsetAnnotation : public TAnnotation { public: TBitsetAnnotation() { } }; template class TBitBoundAnnotation : public TAnnotation { using TAnnotation::impl; public: TBitBoundAnnotation( uint32_t bound) { impl()->bsb(bound); } virtual uint32_t bound() const { return impl()->bsb(); } void bound( uint32_t bound) { impl()->bsb(bound); } }; typedef TAnnotation Annotation; typedef TIdAnnotation IdAnnotation; typedef TKeyAnnotation KeyAnnotation; typedef TSharedAnnotation SharedAnnotation; typedef TNestedAnnotation NestedAnnotation; typedef TExtensibilityAnnotation ExtensibilityAnnotation; typedef TMustUnderstandAnnotation MustUnderstandAnnotation; typedef TVerbatimAnnotation VerbatimAnnotation; typedef TBitsetAnnotation BitsetAnnotation; typedef TBitBoundAnnotation BitBoundAnnotation; //FRANAVA We must think about the fact that previous API has a way of creating a //dynamically defined Annotation. /* namespace converter { IdAnnotation convert(const Annotation& a) { uint32_t idav = reinterpret_cast(a).id(); return IdAnnotation(idav); } } */ namespace annotation { // These functions can be used to get cached instances, // to avoid the proliferation of small annotation objects. IdAnnotation id( uint32_t); KeyAnnotation key(); SharedAnnotation shared(); NestedAnnotation nested(); ExtensibilityAnnotation extensibility( ExtensibilityKind kind); ExtensibilityAnnotation get_final(); ExtensibilityAnnotation extensible(); ExtensibilityAnnotation get_mutable(); MustUnderstandAnnotation must_understand(); VerbatimAnnotation verbatim( const std::string& text); BitsetAnnotation bitset(); BitsetAnnotation bit_bound( uint32_t bound); } //namespace annotation } //namespace xtypes } //namespace core } //namespace dds #endif #endif //OMG_DDS_CORE_XTYPES_TANNOTATION_HPP_