Cyclone ISO C++ API Reference Guide
LoanedSamples.hpp
Go to the documentation of this file.
1 /* Copyright 2010, Object Management Group, Inc.
2 * Copyright 2010, PrismTech, Corp.
3 * Copyright 2010, Real-Time Innovations, Inc.
4 * All rights reserved.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18 #ifndef OMG_DDS_SUB_TLOANED_SAMPLES_HPP_
19 #define OMG_DDS_SUB_TLOANED_SAMPLES_HPP_
20 
21 #include <dds/core/ref_traits.hpp>
22 #include <dds/sub/Sample.hpp>
23 
24 #include <dds/sub/detail/LoanedSamples.hpp>
25 
27 namespace dds
28 {
29 namespace sub
30 {
31 template <typename T,
32  template <typename Q> class DELEGATE = dds::sub::detail::LoanedSamples>
33 class LoanedSamples;
34 
35 // Used by C++11 compilers to allow for using LoanedSamples
36 // and SharedSamples in a range-based for-loop.
37 template <typename T> typename T::const_iterator cbegin(const T& t);
38 template <typename T> typename T::const_iterator cend(const T& t);
39 }
40 
41 }
86 template <typename T>
88 {
89 public:
93  typedef T DataType;
94 
98  typedef typename DELEGATE<T>::const_iterator const_iterator;
99 
101  typedef typename dds::core::smart_ptr_traits::ref_type DELEGATE_REF_T;
104 public:
108  LoanedSamples();
109 
114  ~LoanedSamples();
115 
122  LoanedSamples(const LoanedSamples& other);
123 
124 
125 public:
133  const_iterator begin() const;
134 
142  const_iterator end() const;
143 
153  const DELEGATE_REF_T& delegate() const;
154 
160  DELEGATE_REF_T& delegate();
168  uint32_t length() const;
169 
170 private:
171  DELEGATE_REF_T delegate_;
172 };
173 
174 namespace dds
175 {
176 namespace sub
177 {
183 template <typename T, template <typename Q> class D>
186 }
187 }
188 
189 #include <dds/sub/detail/LoanedSamplesImpl.hpp>
190 
191 #endif /* OMG_DDS_SUB_TLOANED_SAMPLES_HPP_ */
ref_traits.hpp
dds::sub::LoanedSamples
This class encapsulates and automates the management of loaned samples.
Definition: LoanedSamples.hpp:87
dds::sub::move
LoanedSamples< T, D > move(LoanedSamples< T, D > &a)
dds::sub::LoanedSamples::length
uint32_t length() const
dds
Definition: array.hpp:30
dds::sub::LoanedSamples::end
const_iterator end() const
dds::sub::LoanedSamples::DataType
T DataType
Definition: LoanedSamples.hpp:93
Sample.hpp
dds::sub::LoanedSamples::begin
const_iterator begin() const
dds::sub::LoanedSamples::const_iterator
DELEGATE< T >::const_iterator const_iterator
Definition: LoanedSamples.hpp:98
dds::sub::LoanedSamples::LoanedSamples
LoanedSamples()
dds::sub::LoanedSamples::~LoanedSamples
~LoanedSamples()