DDS-PSM-C++  1.0
ISO C++ API for OpenSplice DDS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Value.hpp
Go to the documentation of this file.
1 #ifndef OMG_DDS_CORE_VALUE_HPP_
2 #define OMG_DDS_CORE_VALUE_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 {
24  namespace core {
25  template <typename D>
26  class Value;
27  }
28 }
29 
33 template <typename D>
35 protected:
36  Value();
37  Value(const Value& p);
38 
39 public:
40  template <typename ARG>
41  Value(const ARG& arg);
42 
43  // -- We can't assume that the compiler supports variadic templates,
44  // -- `yet. this code should be refactored to take advantage of compier that
45  // -- do support variadic templates.
46  template <typename ARG1, typename ARG2>
47  Value(const ARG1& arg1, const ARG2& arg2);
48 
49  template <typename ARG1, typename ARG2, typename ARG3>
50  Value(const ARG1& arg1, const ARG2& arg2, const ARG3& arg3);
51 
52  template <typename ARG1, typename ARG2, typename ARG3, typename ARG4>
53  Value(const ARG1& arg1, const ARG2& arg2, const ARG3& arg3, const ARG4& arg4);
54 
55  template <typename ARG1, typename ARG2, typename ARG3, typename ARG4, typename ARG5>
56  Value(const ARG1& arg1, const ARG2& arg2, const ARG3& arg3, const ARG4& arg4, const ARG5& arg5);
57 
58  template <typename ARG1, typename ARG2, typename ARG3, typename ARG4, typename ARG5, typename ARG6>
59  Value(const ARG1& arg1, const ARG2& arg2, const ARG3& arg3, const ARG4& arg4, const ARG5& arg5, const ARG6& arg6);
60 
61 public:
62  ~Value();
63 
64 public:
65  Value& operator=(const Value& other);
66 
67  bool operator==(const Value& other) const;
68 
69  bool operator !=(const Value& other) const;
70 
71 public:
75  const D* operator->() const;
76 
80  D* operator->();
81 
85  const D& delegate() const;
86 
90  D& delegate();
91 
92  operator D& ();
93 
94  operator const D& () const;
95 protected:
96  D d_;
97 };
98 
99 
100 #endif /* OMG_DDS_CORE_VALUE_HPP_ */