OpenSplice ISO C++ 2 DCPS  v6.x
ISO C++ 2 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
Value.hpp
Go to the documentation of this file.
1 /*
2  * Vortex OpenSplice
3  *
4  * This software and documentation are Copyright 2006 to 2021 ADLINK
5  * Technology Limited, its affiliated companies and licensors. All rights
6  * reserved.
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21 #ifndef OSPL_DDS_CORE_DETAIL_VALUE_HPP_
22 #define OSPL_DDS_CORE_DETAIL_VALUE_HPP_
23 
28 /*
29  * OMG PSM class declaration
30  */
31 #include <dds/core/Value.hpp>
32 
33 // Implementation
34 namespace dds
35 {
36 namespace core
37 {
38 
45 template <typename D>
46 Value<D>::Value() { }
47 
48 template <typename D>
49 Value<D>::Value(const Value& p) : d_(p.d_) { }
50 
51 template <typename D>
52 template <typename ARG>
53 Value<D>::Value(const ARG& arg) : d_(arg) { }
54 
55 template <typename D>
56 template <typename ARG1, typename ARG2>
57 Value<D>::Value(const ARG1& arg1, const ARG2& arg2) : d_(arg1, arg2) { }
58 
59 template <typename D>
60 template <typename ARG1, typename ARG2, typename ARG3>
61 Value<D>::Value(const ARG1& arg1, const ARG2& arg2, const ARG3& arg3)
62  : d_(arg1, arg2, arg3) { }
63 
64 template <typename D>
65 template <typename ARG1, typename ARG2, typename ARG3, typename ARG4>
66 Value<D>::Value(const ARG1& arg1, const ARG2& arg2, const ARG3& arg3, const ARG4& arg4)
67  : d_(arg1, arg2, arg3, arg4) { }
68 
69 template <typename D>
70 template <typename ARG1, typename ARG2, typename ARG3, typename ARG4, typename ARG5>
71 Value<D>::Value(const ARG1& arg1, const ARG2& arg2, const ARG3& arg3, const ARG4& arg4, const ARG5& arg5)
72  : d_(arg1, arg2, arg3, arg4, arg5) { }
73 
74 template <typename D>
75 template <typename ARG1, typename ARG2, typename ARG3, typename ARG4, typename ARG5, typename ARG6>
76 Value<D>::Value(const ARG1& arg1, const ARG2& arg2, const ARG3& arg3, const ARG4& arg4, const ARG5& arg5, const ARG6& arg6)
77  : d_(arg1, arg2, arg3, arg4, arg5, arg6) { }
78 
79 template <typename D>
80 Value<D>::~Value() { }
81 
82 template <typename D>
84 {
85  if(this != &other)
86  {
87  d_ = other.d_;
88  }
89  return *this;
90 }
91 
92 template <typename D>
93 bool Value<D>::operator==(const Value& other) const
94 {
95  return (d_ == other.d_);
96 }
97 
98 template <typename D>
99 bool Value<D>::operator !=(const Value& other) const
100 {
101  return !(d_ == other.d_);
102 }
103 
104 template <typename D>
105 const D* Value<D>::operator->() const
106 {
107  return &d_;
108 }
109 
110 template <typename D>
112 {
113  return &d_;
114 }
115 
116 template <typename D>
117 const D& Value<D>::delegate() const
118 {
119  return d_;
120 }
121 
122 template <typename D>
124 {
125  return d_;
126 }
127 
128 template <typename D>
129 Value<D>::operator D& ()
130 {
131  return d_;
132 }
133 
134 template <typename D>
135 Value<D>::operator const D& () const
136 {
137  return d_;
138 }
139 
140 }
141 }
142 // End of implementation
143 
144 #endif /* OSPL_DDS_CORE_DETAIL_VALUE_HPP_ */
bool operator==(dds::core::null_type, const dds::core::Reference< D > &r)
This class is the base for various value-type dds objects.
Definition: Value.hpp:28
Definition: array.hpp:23
bool operator!=(dds::core::null_type, const dds::core::Reference< D > &r)