• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

src/hpp/dds/core/policy/CorePolicy.hpp

Go to the documentation of this file.
00001 #ifndef OMG_DDS_CORE_POLICY_CORE_POLICY_HPP_
00002 #define OMG_DDS_CORE_POLICY_CORE_POLICY_HPP_
00003 
00004 /* Copyright 2010, Object Management Group, Inc.
00005  * Copyright 2010, PrismTech, Corp.
00006  * Copyright 2010, Real-Time Innovations, Inc.
00007  * All rights reserved.
00008  *
00009  * Licensed under the Apache License, Version 2.0 (the "License");
00010  * you may not use this file except in compliance with the License.
00011  * You may obtain a copy of the License at
00012  *
00013  *     http://www.apache.org/licenses/LICENSE-2.0
00014  *
00015  * Unless required by applicable law or agreed to in writing, software
00016  * distributed under the License is distributed on an "AS IS" BASIS,
00017  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00018  * See the License for the specific language governing permissions and
00019  * limitations under the License.
00020  */
00021 
00022 #include <dds/core/corefwd.hpp>
00023 #include <dds/core/policy/detail/CorePolicy.hpp>
00024 #include <dds/core/policy/PolicyKind.hpp>
00025 
00026 
00027 //==============================================================================
00028 // MACROS
00029 //
00030 #define OMG_DDS_POLICY_TRAITS(POLICY, ID) \
00031         template <> \
00032         class policy_id<POLICY> { \
00033         public: \
00034             static const dds::core::policy::QosPolicyId value = ID; \
00035         }; \
00036         template <> \
00037         class policy_name<POLICY> { \
00038             static const std::string& name(); \
00039         };
00040 
00041 #define OMG_DDS_DEFINE_POLICY_TRAITS(POLICY, NAME) \
00042         const std::string& dds::core::policy::policy_name<POLICY>::name() { \
00043             static std::string the_name = #NAME; \
00044             return the_name; \
00045         }
00046 
00047 
00048 //==============================================================================
00049 // Policy Trait Classes
00050 
00051 template <typename Policy>
00052 class dds::core::policy::policy_id { };
00053 
00054 template <typename Policy>
00055 class dds::core::policy::policy_name { };
00056 
00057 
00058 namespace dds { namespace core { namespace policy  {
00059 
00060 OMG_DDS_POLICY_TRAITS(UserData,             1)
00061 OMG_DDS_POLICY_TRAITS(Durability,           2)
00062 OMG_DDS_POLICY_TRAITS(Presentation,         3)
00063 OMG_DDS_POLICY_TRAITS(Deadline,             4)
00064 OMG_DDS_POLICY_TRAITS(LatencyBudget,        5)
00065 OMG_DDS_POLICY_TRAITS(Ownership,            6)
00066 
00067 #ifdef OMG_DDS_OWNERSHIP_SUPPORT
00068 OMG_DDS_POLICY_TRAITS(OwnershipStrength,    7)
00069 #endif  // OMG_DDS_OWNERSHIP_SUPPORT
00070 
00071 OMG_DDS_POLICY_TRAITS(Liveliness,           8)
00072 OMG_DDS_POLICY_TRAITS(TimeBasedFilter,      9)
00073 OMG_DDS_POLICY_TRAITS(Partition,            10)
00074 OMG_DDS_POLICY_TRAITS(Reliability,          11)
00075 OMG_DDS_POLICY_TRAITS(DestinationOrder,     12)
00076 OMG_DDS_POLICY_TRAITS(History,              13)
00077 OMG_DDS_POLICY_TRAITS(ResourceLimits,       14)
00078 OMG_DDS_POLICY_TRAITS(EntityFactory,        15)
00079 OMG_DDS_POLICY_TRAITS(WriterDataLifecycle,  16)
00080 OMG_DDS_POLICY_TRAITS(ReaderDataLifecycle,  17)
00081 OMG_DDS_POLICY_TRAITS(TopicData,            18)
00082 OMG_DDS_POLICY_TRAITS(GroupData,            19)
00083 OMG_DDS_POLICY_TRAITS(TransportPriority,    20)
00084 OMG_DDS_POLICY_TRAITS(Lifespan,             21)
00085 
00086 #ifdef  OMG_DDS_PERSISTENCE_SUPPORT
00087 OMG_DDS_POLICY_TRAITS(DurabilityService,    22)
00088 #endif  // OMG_DDS_PERSISTENCE_SUPPORT
00089 
00090 } } }
00091 
00092 
00093 #endif /* OMG_DDS_CORE_POLICY_CORE_POLICY_HPP_ */

Generated on Tue Nov 9 2010 02:16:21 for dds-psm-cxx-doc by  doxygen 1.7.1