OpenSplice ISO C++ 2 DCPS  v6.x
ISO C++ 2 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
StructType.hpp
Go to the documentation of this file.
1 /* Copyright 2010, Object Management Group, Inc.
2 * Copyright 2010, PrismTech, Corp.
3 * Copyright 2010, Real-Time Innovations, Inc.
4 * All rights reserved.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18 #ifndef OMG_DDS_CORE_XTYPES_T_STRUCT_TYPE_HPP_
19 #define OMG_DDS_CORE_XTYPES_T_STRUCT_TYPE_HPP_
20 
24 
25 namespace dds
26 {
27 namespace core
28 {
29 namespace xtypes
30 {
31 
32 class StructType;
33 
34 
35 class StructForwardDeclaration;
36 
37 template <typename T>
38 bool isFinal(const StructType<T>& s);
39 
40 template <typename T>
41 bool isExtensible(const StructType<T>& s);
42 
43 template <typename T>
44 bool isMutable(const StructType<T>& s);
45 
46 template <typename T>
47 bool isNested(const StructType<T>& s);
48 }
49 }
50 }
51 
56 class dds::core::xtypes::StructForwardDeclaration : public dds::core::xtypes::DynamicType
57 {
58 public:
59  StructForwardDeclaration(const std::string& name);
60 };
61 
68 class dds::core::xtypes::StructType : public dds::core::xtypes::DynamicType
69 {
70 public:
71 
72  StructType(const std::string& name);
73 
74  StructType(
75  const std::string& name,
76  const StructType& parent,
77  const std::vector<MemberType>& members);
78 
79  template <typename MemberIter>
80  StructType(
81  const std::string& name,
82  const StructType& parent,
83  const MemberIter& begin,
84  const MemberIter& end);
85 
86  StructType(
87  const std::string& name,
88  const StructType& parent,
89  const std::vector<MemberType>& members,
90  const Annotation& annotation);
91 
92  StructType(
93  const std::string& name,
94  const StructType& parent,
95  const std::vector<MemberType>& members,
96  const std::vector<Annotation>& annotations);
97 
98  template <typename AnnotationIter, typename MemberIter>
99  StructType(
100  const std::string& name,
101  const StructType& parent,
102  const MemberIter& begin,
103  const MemberIter& end,
104  const AnnotationIter& begin,
105  const AnnotationIter& end);
106 public:
107  StructType parent() const;
108  const std::vector<MemberType>& members() const;
109  const MemberType& member(uint32_t id) const;
110  const MemberType& member(const std::string& name) const;
111 
112  const std::vector<Annotation>& annotations() const;
113 
114  StructType add_member(const MemberType& member) const ;
115  StructType remove_member(const MemberType& member) const;
116 
117  StructType add_annotation(const Annotation& annotation) const;
118  StructType remove_annotation(const Annotation& annotation) const;
119 };
120 
121 
122 #endif /* OMG_DDS_CORE_XTYPES_T_STRUCT_TYPE_HPP_ */
StructForwardDeclaration(const std::string &name)
bool isNested(const StructType< T > &s)
bool isFinal(const StructType< T > &s)
Definition: array.hpp:23
bool isMutable(const StructType< T > &s)
bool isExtensible(const StructType< T > &s)