OpenSplice ISO C++ 2 DCPS  v6.x
ISO C++ 2 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
SampleImpl.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_SUB_TSAMPLE_HPP_
22 #define OSPL_DDS_SUB_TSAMPLE_HPP_
23 
28 /*
29  * OMG PSM class declaration
30  */
31 #include <dds/sub/Sample.hpp>
32 
33 // Implementation
34 namespace dds
35 {
36 namespace sub
37 {
38 
39 template <typename T>
40 Sample<T>::Sample() : dds::core::Value() {}
41 
42 template <typename T>
43 Sample<T>::Sample(const T& data, const SampleInfo& info) : dds::core::Value(data, info) { }
44 
45 template <typename T>
46 Sample<T>::Sample(const Sample& other) : dds::core::Value(other.delegate()) { }
47 
48 template <typename T>
49 const typename Sample<T>::DataType& Sample<T>::data() const
50 {
51  return this->delegate().data();
52 }
53 
54 template <typename T>
55 void Sample<T>::data(const DataType& d)
56 {
57  this->delegate().data(d);
58 }
59 
60 template <typename T>
62 {
63  return this->delegate().info();
64 }
65 
66 template <typename T>
68 {
69  this->delegate().info(i);
70 }
71 
72 }
73 }
74 // End of implementation
75 #endif /* OSPL_DDS_SUB_TSAMPLE_HPP_ */
const SampleInfo & info() const
Definition: SampleImpl.hpp:61
The SampleInfo contains information pertaining to the associated Data value.
Definition: SampleInfo.hpp:61
const DataType & data() const
Definition: SampleImpl.hpp:49
Definition: array.hpp:23
This class encapsulates the data and info meta-data associated with DDS samples.
Definition: Sample.hpp:30