48 template <
bool,
typename T,
typename U>
53 template <
typename T,
typename U>
54 struct if_ <false, T, U> {
69 template <
typename TReq,
typename TRep>
class Requester;
70 template <
typename TReq,
typename TRep>
class Replier;
74 struct dds_type_traits
76 typedef typename T::Seq Seq;
77 typedef const typename T::Seq ConstSeq;
78 typedef typename T::DataReader * DataReader;
91 struct dds_type_traits<
DDS::SampleInfo>
97 struct dds_entity_traits;
108 template <
typename T>
113 typedef T& DataReference;
114 typedef const T& ConstDataReference;
115 typedef typename DDS::dds_type_traits<T>::Seq Seq;
116 typedef typename DDS::dds_type_traits<T>::DataReader DataReader;
117 typedef typename DDS::dds_type_traits<T>::DataWriter
DataWriter;
130 Sample(
const T &data,
const DDS::SampleInfo& info);
146 void swap(
Sample & other);
152 DDS::SampleInfo & info();
155 const T & data()
const;
158 const DDS::SampleInfo & info()
const;
162 void set_data(
const T &t);
165 void set_data(
const T *t);
168 void set_info(
const DDS::SampleInfo &i);
171 void set_info(
const DDS::SampleInfo *i);
181 operator DataReference ();
184 operator ConstDataReference ()
const;
193 DDS::SampleInfo * _info;
210 template <
typename T>
215 typedef T& DataReference;
216 typedef const T& ConstDataReference;
217 typedef typename DDS::dds_type_traits<T>::Seq Seq;
218 typedef typename DDS::dds_type_traits<T>::DataReader DataReader;
219 typedef typename DDS::dds_type_traits<T>::DataWriter DataWriter;
227 SampleRef(T * data, DDS::SampleInfo * info);
230 SampleRef(T & data, DDS::SampleInfo & info);
243 DDS::SampleInfo & info()
const;
246 operator T & ()
const;
257 void set_data(T * data);
260 void set_data(T & data);
263 void set_info(DDS::SampleInfo * info);
266 void set_info(DDS::SampleInfo & info);
269 bool is_nil_data()
const;
272 bool is_nil_info()
const;
292 DDS::SampleInfo * _info;
305 template <
typename T,
bool IsConst>
309 typedef std::random_access_iterator_tag iterator_category;
313 typedef typename details::if_<IsConst,
317 typedef value_type reference;
318 typedef value_type pointer;
323 typedef typename details::if_<IsConst,
324 typename dds_type_traits<T>::ConstSeq,
325 typename dds_type_traits<T>::Seq>::type Seq;
327 typedef typename details::if_<IsConst,
328 typename dds_type_traits<DDS::SampleInfo>::ConstSeq,
329 typename dds_type_traits<DDS::SampleInfo>::Seq>::type InfoSeq;
348 value_type operator * ()
const;
352 value_type operator ->()
const;
356 value_type operator [] (difference_type offset)
const;
414 template <
typename T>
427 template <
typename T>
431 typedef typename dds_type_traits<T>::Seq Seq;
432 typedef typename dds_type_traits<T>::DataReader
DataReader;
466 static
LoanedSamples<T> move_construct_from_loans(DataReader reader,
474 void release(DataReader & reader_ptr,
478 #ifdef TOC_MOVE_SEMANTICS_AVAILABLE 499 LoanedSamples & operator = (LoanMemento loan_memento)
throw();
500 operator LoanMemento () throw();
514 const Seq & data_seq()
const;
522 value_type operator [] (
size_t index);
526 const_value_type operator [] (
size_t index)
const;
532 int size()
const {
return this->length(); }
556 const_iterator begin()
const;
559 const_iterator end()
const;
566 #ifndef TOC_MOVE_SEMANTICS_AVAILABLE 581 template <
typename T>
585 typedef typename dds_type_traits<T>::Seq Seq;
586 typedef typename dds_type_traits<T>::DataReader DataReader;
626 const Seq & data_seq() const;
633 value_type operator [] (
size_t index);
637 const_value_type operator [] (
size_t index) const;
643 void swap(SharedSamples & that) throw();
652 const_iterator begin() const;
655 const_iterator end() const;
668 template <typename T>
681 WriteSample(
const T & data);
698 const T & data()
const;
704 void set_data(
const T & data);
710 void swap(WriteSample & other)
throw();
730 template <
typename T>
754 const T & data()
const;
760 void set_data(T & data);
784 #ifdef TOC_MOVE_SEMANTICS_AVAILABLE 785 template <
typename T>
788 return std::move(ls);
791 template <
typename T>
798 template <
typename T>
804 template <
typename T>
810 template <
typename T>
816 template <
typename T>
822 template <
typename T>
828 template <
typename T>
834 template <
typename T>
840 template <
typename T>
846 template <
typename T>
852 template <
typename T>
863 #include <dds/sample_tmpl.hh> 864 #include <dds/sampleref_tmpl.hh> 865 #include <dds/sampleiterator_tmpl.hh> 866 #include <dds/loanedsamples_tmpl.hh> 867 #include <dds/sharedsamples_tmpl.hh> 868 #include <dds/writesample_tmpl.hh> 869 #include <dds/writesampleref_tmpl.hh> 872 #endif // DDS_SAMPLE_HH SampleIterator< T, true > const_iterator
Definition: sample.hh:593
The DataWriter entity provides an interface for the application to publish (write) data...
Definition: dds.hh:2179
A Requester sends requests and receives replies.
Definition: request_reply.hh:54
SampleIterator< T, false > iterator
Definition: sample.hh:590
dds_type_traits< T >::ConstSampleIteratorValueType const_value_type
Definition: sample.hh:600
A replier receives requests and send replies.
Definition: request_reply.hh:57
Holds a collection of sample data and related meta-data.
Definition: sample.hh:65
iterator begin()
Obtain a SampleIterator object that refers to the beginning of the data sequence. ...
Holds a reference to sample data intended for transmission.
Definition: sample.hh:64
Sample()
Default constructor. Empty data.
Definition: sample.hh:121
Sample holds the data and related meta information.
Definition: sample.hh:61
void swap(LoanedSamples &that)
Swap contents and responsibility between this and 'that'.
SampleIterator< T, true > const_iterator
Definition: sample.hh:439
details::if_< IsConst, typename dds_type_traits< T >::ConstSampleIteratorValueType, typename dds_type_traits< T >::SampleIteratorValueType >::type value_type
Definition: sample.hh:315
SampleRef holds a reference to data and related meta information.
Definition: sample.hh:62
The DataReader entity allows the application to subscribe to and read data.
Definition: dds.hh:2466
std::ptrdiff_t difference_type
Definition: sample.hh:449
SampleIterator< T, false > iterator
Definition: sample.hh:436
Provides the DDS infrastructure.
Definition: dds_builtin_basic.hh:28
Holds sample data intended for transmission.
Definition: sample.hh:63
dds_type_traits< T >::SampleIteratorValueType value_type
Definition: sample.hh:597
iterator end()
Obtain a SampleIterator object that refers to the end of the data sequence.
Definition: dds_builtin_basic.hh:239
dds_type_traits< T >::ConstSampleIteratorValueType const_value_type
Definition: sample.hh:446
std::ptrdiff_t difference_type
Definition: sample.hh:321
int size() const
Access the length of the contained data sequence.
Definition: sample.hh:532
iterator end()
Obtain an iterator that refers to the end of the contained sequences.
dds_type_traits< T >::SampleIteratorValueType value_type
Definition: sample.hh:443
Provides a means to iterate over a collection of Samples.
Definition: sample.hh:60
std::ptrdiff_t difference_type
Definition: sample.hh:603
iterator begin()
Obtain an iterator that refers to the beginning of the contained sequences.
Holds a reference to a collection of sample data and related meta-data.
Definition: sample.hh:66
void swap(SharedSamples &that)
Swap the contents of this with 'that'.