OpenSplice ISO C++ 2 DCPS  v6.x
ISO C++ 2 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
SharedSamples.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_SHARED_SAMPLES_HPP_
19 #define OMG_DDS_SUB_SHARED_SAMPLES_HPP_
20 
21 
22 #include <dds/core/Reference.hpp>
23 #include <dds/sub/Sample.hpp>
26 
28 namespace dds
29 {
30 namespace sub
31 {
32 template <typename T,
33  template <typename Q> class DELEGATE = detail::SharedSamples>
34 class SharedSamples;
35 }
36 }
48 template <typename T>
50 {
51 public:
52  typedef T DataType;
53  typedef typename DELEGATE<T>::const_iterator const_iterator;
54 
55  typedef typename dds::core::smart_ptr_traits::ref_type DELEGATE_REF_T;
56 
57 public:
61  SharedSamples();
62 
75 
79  SharedSamples(const SharedSamples& other);
80 
82 
83 
84 public:
90  const_iterator begin() const;
91 
97  const_iterator end() const;
98 
104  const DELEGATE_REF_T& delegate() const;
105 
111  DELEGATE_REF_T& delegate();
112 
118  uint32_t length() const;
119 
120 private:
121  DELEGATE_REF_T delegate_;
122 };
123 
125 
126 #endif /* OMG_DDS_SUB_SHARED_SAMPLES_HPP_ */
const_iterator begin() const
const DELEGATE_REF_T & delegate() const
Definition: array.hpp:23
dds::core::smart_ptr_traits::ref_type DELEGATE_REF_T
This class encapsulates and automates the management of loaned samples.
const_iterator end() const
This class encapsulates and automates the management of loaned samples.
DELEGATE< T >::const_iterator const_iterator