Go to the documentation of this file.00001 #ifndef OMG_DDS_CORE_VALUE_HPP_
00002 #define OMG_DDS_CORE_VALUE_HPP_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <dds/core/corefwd.hpp>
00023
00024
00025 namespace dds { namespace core {
00026
00030 template <typename D>
00031 class Value {
00032 protected:
00033 Value() { }
00034 Value(const Value& p) : d_(p.d_) { }
00035
00036 public:
00037 template <typename ARG>
00038 Value(const ARG& arg) : d_(arg) { }
00039
00040 template <typename ARG1, typename ARG2>
00041 Value(const ARG1& arg1, const ARG2& arg2) : d_(arg1, arg2) { }
00042
00043 template <typename ARG1, typename ARG2, typename ARG3>
00044 Value(const ARG1& arg1, const ARG2& arg2, const ARG3& arg3)
00045 : d_(arg1, arg2, arg3) { }
00046
00047 public:
00048 ~Value() { }
00049
00050 public:
00051 Value& operator=(const Value& other) {
00052 if (this != &other) {
00053 d_ = other.d_;
00054 }
00055 return *this;
00056 }
00057
00058 bool operator==(const Value& other) {
00059 return (d_ == other.d_);
00060 }
00061
00062 bool operator !=(const Value& other) {
00063 return !(d_ == other.d_);
00064 }
00065
00066 public:
00067 const D* operator->() const { return d_; }
00068 D* operator->() { return &d_; }
00069
00070 const D& delegate() const { return d_; }
00071 D& delegate() { return d_;}
00072
00073 protected:
00074 D d_;
00075 };
00076
00077 } }
00078
00079 #endif