DDS-PSM-C++  1.0
ISO C++ API for OpenSplice DDS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
CorePolicy.hpp
Go to the documentation of this file.
1 #ifndef OMG_DDS_CORE_POLICY_CORE_POLICY_HPP_
2 #define OMG_DDS_CORE_POLICY_CORE_POLICY_HPP_
3 
4 /* Copyright 2010, Object Management Group, Inc.
5  * Copyright 2010, PrismTech, Corp.
6  * Copyright 2010, Real-Time Innovations, Inc.
7  * All rights reserved.
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
25 
26 
27 
28 //==============================================================================
29 // MACROS
30 //
31 #define OMG_DDS_POLICY_TRAITS(POLICY, ID) \
32  template <> \
33  class policy_id<POLICY> { \
34  public: \
35  static const dds::core::policy::QosPolicyId value = ID; \
36 }; \
37 template <> \
38 class policy_name<POLICY> { \
39 public:\
40 static const std::string& name(); \
41 };
42 
43 #define OMG_DDS_DEFINE_POLICY_TRAITS(POLICY, NAME) \
44  const std::string& dds::core::policy::policy_name<POLICY>::name() { \
45  static std::string the_name = #NAME; \
46  return the_name; \
47 }
48 
49 
50 namespace dds { namespace core { namespace policy {
51 
52  //==============================================================================
53  // Policy Trait Classes
54 
55  template <typename Policy>
56  class policy_id { };
57 
58  template <typename Policy>
59  class policy_name { };
60 
61 
62 
63 #ifdef OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT
64  typedef uint16_t DataRepresentationId;
65 
66  typedef std::vector<DataRepresentationId> DataRepresentationIdSeq;
67 #endif
68 
71 
74 
77 
80 
83 
86 
89 
92 
95 
98 
99 #ifdef OMG_DDS_OWNERSHIP_SUPPORT
100  typedef dds::core::policy::detail::OwnershipStrength
101  OwnershipStrength;
102 #endif // OMG_DDS_OWNERSHIP_SUPPORT
103 
106 
107  template <typename Policy>
108  class policy_id;
109 
110  template <typename Policy>
111  class policy_name;
112 
114  Presentation;
115 
117 
118  typedef std::vector<QosPolicyCount> QosPolicyCountSeq;
119 
120  typedef uint32_t QosPolicyId;
121 
124 
127 
130 
133 
136 
139 
142 
145 
146 #ifdef OMG_DDS_PERSISTENCE_SUPPORT
147 typedef ::dds::core::policy::detail::DurabilityService
148  DurabilityService;
149 #endif // OMG_DDS_PERSISTENCE_SUPPORT
150 
151 #ifdef OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT
152 // TODO
153 #endif
154 
155 
156 
163 
164 #ifdef OMG_DDS_OWNERSHIP_SUPPORT
165 OMG_DDS_POLICY_TRAITS(OwnershipStrength, 7)
166 #endif // OMG_DDS_OWNERSHIP_SUPPORT
167 
182 
183 #ifdef OMG_DDS_PERSISTENCE_SUPPORT
184 OMG_DDS_POLICY_TRAITS(DurabilityService, 22)
185 #endif // OMG_DDS_PERSISTENCE_SUPPORT
186 
187 
188 
189 } } }
190 
191 
192 #endif /* OMG_DDS_CORE_POLICY_CORE_POLICY_HPP_ */