DDS-PSM-C++  1.0
ISO C++ API for OpenSplice DDS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
TopicTraits.hpp
Go to the documentation of this file.
1 #ifndef OMG_DDS_TOPIC_TOPIC_TRAITS_HPP_
2 #define OMG_DDS_TOPIC_TOPIC_TRAITS_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 
22 //==============================================================================
23 namespace dds { namespace topic {
24  template <typename T>
25  struct is_topic_type;
26 
27  template <typename T>
29 
30  template <typename T>
31  struct topic_type_name {
32  static std::string value() {
33  return "Undefined";
34  }
35  };
36 
37 } }
38 
39 //==============================================================================
40 template <typename T>
42  enum {value = 0 };
43 };
44 
45 template <typename T>
47 
48 
49 #define REGISTER_TOPIC_TYPE(TOPIC_TYPE) \
50  namespace dds { namespace topic { \
51  template<> struct is_topic_type<TOPIC_TYPE> { \
52  enum { value = 1 }; \
53  }; } }
54 
55 #endif /* OMG_DDS_TOPIC_TOPIC_TRAITS_HPP_ */