Public Types | Public Member Functions | Private Attributes
icl_core::Stamped< DataType > Struct Template Reference

#include <DataHeader.h>

Inheritance diagram for icl_core::Stamped< DataType >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef boost::shared_ptr
< const Stamped< DataType > > 
ConstPtr
 Convenience smart pointer typedef.
typedef boost::shared_ptr
< Stamped< DataType > > 
Ptr
 Convenience smart pointer typedef.

Public Member Functions

const DataType & cget () const
DataType & get ()
const DataType & get () const
virtual DataHeaderheader ()
 Access the data header.
virtual const DataHeaderheader () const
 Access the data header (const version).
 operator DataType () const
 Implicit conversion back to the original data type.
DataType & operator* ()
 Quick access to the wrapped data.
const DataType & operator* () const
 Quick access to the wrapped data.
DataType * operator-> ()
 Quick access to the wrapped data.
const DataType * operator-> () const
 Quick access to the wrapped data.
virtual void print (std::ostream &os) const
 Stamped ()
 Default constructor which leaves the data uninitialized.
 Stamped (const DataType &data)
 Implicit construction from a data value.
 Stamped (const DataHeader &header)
 Implicit construction from a data header.
 Stamped (const DataType &data, const DataHeader &header)
 Full constructor.

Private Attributes

DataType m_data
 The wrapped data.
DataHeader m_header
 The data header.

Detailed Description

template<class DataType>
struct icl_core::Stamped< DataType >

A generic wrapper for combining any kind of data with a DataHeader.

Definition at line 163 of file DataHeader.h.


Member Typedef Documentation

template<class DataType>
typedef boost::shared_ptr<const Stamped<DataType> > icl_core::Stamped< DataType >::ConstPtr

Convenience smart pointer typedef.

Reimplemented from icl_core::StampedBase.

Definition at line 185 of file DataHeader.h.

template<class DataType>
typedef boost::shared_ptr<Stamped<DataType> > icl_core::Stamped< DataType >::Ptr

Convenience smart pointer typedef.

Reimplemented from icl_core::StampedBase.

Definition at line 183 of file DataHeader.h.


Constructor & Destructor Documentation

template<class DataType>
icl_core::Stamped< DataType >::Stamped ( ) [inline]

Default constructor which leaves the data uninitialized.

Definition at line 188 of file DataHeader.h.

template<class DataType>
icl_core::Stamped< DataType >::Stamped ( const DataType &  data) [inline]

Implicit construction from a data value.

Definition at line 193 of file DataHeader.h.

template<class DataType>
icl_core::Stamped< DataType >::Stamped ( const DataHeader header) [inline]

Implicit construction from a data header.

Definition at line 199 of file DataHeader.h.

template<class DataType>
icl_core::Stamped< DataType >::Stamped ( const DataType &  data,
const DataHeader header 
) [inline]

Full constructor.

Definition at line 204 of file DataHeader.h.


Member Function Documentation

template<class DataType>
const DataType& icl_core::Stamped< DataType >::cget ( ) const [inline]

Explicitly const access to the wrapped data. This is in anticipation of C++11, to allow correct type deduction for the auto keyword.

Definition at line 229 of file DataHeader.h.

template<class DataType>
DataType& icl_core::Stamped< DataType >::get ( ) [inline]

Access to the wrapped data. While direct access to the #data member is allowed, the access functions should be preferred.

Definition at line 220 of file DataHeader.h.

template<class DataType>
const DataType& icl_core::Stamped< DataType >::get ( ) const [inline]

Access to the wrapped data. While direct access to the #data member is allowed, the access functions should be preferred.

Definition at line 224 of file DataHeader.h.

template<class DataType>
virtual DataHeader& icl_core::Stamped< DataType >::header ( ) [inline, virtual]

Access the data header.

Implements icl_core::StampedBase.

Definition at line 213 of file DataHeader.h.

template<class DataType>
virtual const DataHeader& icl_core::Stamped< DataType >::header ( ) const [inline, virtual]

Access the data header (const version).

Implements icl_core::StampedBase.

Definition at line 215 of file DataHeader.h.

template<class DataType>
icl_core::Stamped< DataType >::operator DataType ( ) const [inline]

Implicit conversion back to the original data type.

Definition at line 210 of file DataHeader.h.

template<class DataType>
DataType& icl_core::Stamped< DataType >::operator* ( ) [inline]

Quick access to the wrapped data.

Definition at line 232 of file DataHeader.h.

template<class DataType>
const DataType& icl_core::Stamped< DataType >::operator* ( ) const [inline]

Quick access to the wrapped data.

Definition at line 234 of file DataHeader.h.

template<class DataType>
DataType* icl_core::Stamped< DataType >::operator-> ( ) [inline]

Quick access to the wrapped data.

Definition at line 237 of file DataHeader.h.

template<class DataType>
const DataType* icl_core::Stamped< DataType >::operator-> ( ) const [inline]

Quick access to the wrapped data.

Definition at line 239 of file DataHeader.h.

template<class DataType>
virtual void icl_core::Stamped< DataType >::print ( std::ostream &  os) const [inline, virtual]

Prints the contents to the given output stream. Note that this method tries to produce output for #data only if it is known at compile time that a suitable stream operator is available. This relies on the boost::has_left_shift<> type trait. Note that there are some (rare) cases where this might not work as expected (see the Boost TypeTraits documentation for details):

  • The class cannot detect if the operator<< is private. If it is, then you will get a compiler error.
  • There is an issue if the operator exists only for type A and B is convertible to A. In this case, the compiler will report an ambiguous overload.
  • There is an issue when applying this trait to template classes. If operator<< is defined but does not bind for a given template type, it is still detected by the trait which returns true instead of false, resulting in a compiler error.
  • The volatile qualifier is not properly handled and would lead to undefined behavior.
See also:
StampedBase::print()

Implements icl_core::StampedBase.

Definition at line 262 of file DataHeader.h.


Member Data Documentation

template<class DataType>
DataType icl_core::Stamped< DataType >::m_data [private]

The wrapped data.

Definition at line 170 of file DataHeader.h.

template<class DataType>
DataHeader icl_core::Stamped< DataType >::m_header [private]

The data header.

Definition at line 172 of file DataHeader.h.


The documentation for this struct was generated from the following file:


schunk_svh_driver
Author(s): Georg Heppner
autogenerated on Fri Aug 28 2015 12:59:20