OpenSplice ISO C++ 2 DCPS  v6.x
ISO C++ 2 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
LoanedSamplesImpl.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_DETAIL_LOANED_SAMPLES_IMPL_HPP_
22 #define OSPL_DDS_SUB_DETAIL_LOANED_SAMPLES_IMPL_HPP_
23 
28 /*
29  * OMG PSM class declaration
30  */
31 
32 // Implementation
33 
34 namespace dds
35 {
36 namespace sub
37 {
38 
39 template <typename T>
40 LoanedSamples<T>::LoanedSamples() : delegate_(new DELEGATE<T>()) { }
41 
42 template <typename T>
44 
45 template <typename T>
47 {
48  delegate_ = other.delegate_;
49 }
50 
51 template <typename T>
53 {
54  return delegate()->begin();
55 }
56 
57 template <typename T>
59 {
60  return delegate()->end();
61 }
62 
63 template <typename T>
65 {
66  return delegate_;
67 }
68 
69 template <typename T>
71 {
72  return delegate_;
73 }
74 
75 template <typename T>
76 uint32_t LoanedSamples<T>::length() const
77 {
78  return delegate_->length();
79 }
80 
81 template <typename T, template <typename Q> class D>
83 {
84  /* Copy reference (not the data) into new LoanedSamples. */
85  LoanedSamples<T, D> samples(a);
86  /* Reset reference of the old LoanedSamples. */
87  a.delegate() = NULL;
88  /* Move is completed. */
89  return samples;
90 }
91 
92 }
93 }
94 
95 // End of implementation
96 
97 #endif /* OSPL_DDS_SUB_DETAIL_LOANED_SAMPLES_IMPL_HPP_ */
const_iterator begin() const
LoanedSamples< T, D > move(LoanedSamples< T, D > &a)
Definition: array.hpp:23
const_iterator end() const
This class encapsulates and automates the management of loaned samples.
DELEGATE< T >::const_iterator const_iterator