OpenSplice ISO C++ 2 DCPS  v6.x
ISO C++ 2 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
InstanceHandleImpl.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_TINSTANCEHANDLE_IMPL_HPP_
22 #define OSPL_DDS_CORE_TINSTANCEHANDLE_IMPL_HPP_
23 
28 #include <org/opensplice/core/InstanceHandleDelegate.hpp>
29 
30 /*
31  * OMG PSM class declaration
32  */
34 
35 // Implementation
36 namespace dds
37 {
38 namespace core
39 {
40 
41 
43 
44 
45 template <typename ARG0>
46 InstanceHandle::InstanceHandle(const ARG0& arg0) : dds::core::Value(arg0) { }
47 
48 
49 InstanceHandle::InstanceHandle(const dds::core::null_type& nullHandle) : dds::core::Value(nullHandle) { }
50 
51 
52 InstanceHandle::InstanceHandle(const InstanceHandle& other): dds::core::Value(other.delegate()) { }
53 
54 
55 InstanceHandle::~InstanceHandle() { }
56 
57 
59 {
60  if(this != &that)
61  {
62  this->delegate() = that.delegate();
63  }
64  return *this;
65 }
66 
67 
69 {
70  return this->delegate() == that.delegate();
71 }
72 
73 
75 {
76  return this->delegate() < that.delegate();
77 }
78 
79 
81 {
82  return this->delegate() > that.delegate();
83 }
84 
85 
87 {
89  static InstanceHandle nil_handle(nt);
90  return nil_handle;
91 }
92 
93 
95 {
96  return this->delegate().is_nil();
97 }
98 }
99 }
100 
101 inline std::ostream& operator << (std::ostream& os, const dds::core::InstanceHandle<org::opensplice::core::InstanceHandleDelegate>& h)
102 {
103  os << h.delegate();
104  return os;
105 }
106 
107 // End of implementation
108 
109 #endif /* OSPL_DDS_CORE_TINSTANCEHANDLE_IMPL_HPP_ */
bool operator>(const InstanceHandle &that) const
This class is the base for various value-type dds objects.
Definition: Value.hpp:28
InstanceHandle & operator=(const InstanceHandle &that)
This class is used to create dds::core::null objects.
Definition: types.hpp:49
Class to hold the handle associated with in sample instance.
bool operator==(const InstanceHandle &that) const
Definition: array.hpp:23
static const InstanceHandle nil()
bool operator<(const InstanceHandle &that) const