DDS-PSM-C++  1.0
ISO C++ API for OpenSplice DDS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
UnionType.hpp
Go to the documentation of this file.
1 #ifndef OMG_DDS_CORE_XTYPES_T_UNION_TYPE_HPP_
2 #define OMG_DDS_CORE_XTYPES_T_UNION_TYPE_HPP_
3 
8 #include <vector>
9 
10 namespace dds {
11  namespace core {
12  namespace xtypes {
13  template <typename T, template <typename Q> class DELEGATE = detail::UnionType >
14  class UnionType;
15  }
16  }
17 }
18 
19 template <typename T, typename DELEGATE>
21 public:
22 
23  UnionType(
24  const std::string& name,
25  const TPrimitiveType<T>& discriminator_type,
26  const std::vector<UnionCase<T> >& cases);
27 
28  UnionType(
29  const std::string& name,
30  const TPrimitiveType<T>& discriminator_type,
31  const std::vector<UnionCase<T> >& cases,
32  const Annotation& annotation);
33 
34  UnionType(
35  const std::string& name,
36  const TPrimitiveType<T>& discriminator_type,
37  const std::vector<UnionCase<T> >& cases,
38  const std::vector<Annotation>& annotations);
39 
40  public:
41 
42  const std::vector<UnionCase<T> >& members() const;
43  const MemberType& member(uint32_t id) const;
44  const MemberType& member(const std::string& name) const;
45 
46  const std::vector<Annotation>& annotations() const;
47 
48  UnionType add_member(const UnionCase<T>& member) const;
49  UnionType remove_member(const UnionCase<T>& member) const;
50 
51  UnionType add_annotation(const Annotation& annotation) const;
52  UnionType remove_annotation(const Annotation& annotation) const;
53 
54 };
55 
56 #endif /* OMG_DDS_CORE_XTYPES_T_STRUCT_TYPE_HPP_ */