Public Member Functions | Static Protected Member Functions | Protected Attributes
variant_topic_tools::MessageField< T > Class Template Reference

Message field template. More...

#include <MessageField.h>

Inheritance diagram for variant_topic_tools::MessageField< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void clear ()
 Clear the message field.
const std::string & getName () const
 Retrieve the name of the message field.
T & getValue ()
 Retrieve the value of the message field (non-const version)
const T & getValue () const
 Retrieve the value of the message field (const version)
bool isValid () const
 True, if this message field is valid.
 MessageField (const std::string &name=std::string(), const T &value=T())
 Default constructor.
 MessageField (const MessageField< T > &src)
 Copy constructor.
bool operator!= (const MessageField< T > &field) const
 True, if this message field is not equal to another message field.
bool operator== (const MessageField< T > &field) const
 True, if this message field is equal to another message field.
void setName (const std::string &name)
 Set the name of the message field.
void setValue (const T &value)
 Set the value of the message field.
void write (std::ostream &stream, const std::string &indent=std::string()) const
 Write the message field to a stream.
virtual ~MessageField ()
 Destructor.

Static Protected Member Functions

template<typename U >
static bool isValid (const U &value, typename boost::enable_if_c< MessageFieldTypeTraits::HasIsValid< U >::value >::type *=0)
 True, if the message field is valid (overloaded version taking a field value which can be validated)
template<typename U >
static bool isValid (const U &value, typename boost::disable_if_c< MessageFieldTypeTraits::HasIsValid< U >::value >::type *=0)
 True, if the message field is valid (overloaded version taking a field value which cannot be validated)
template<typename U >
static void writeValue (std::ostream &stream, const U &value, typename boost::enable_if< boost::has_left_shift< std::ostream, const U & > >::type *=0)
 Write a message field value to a stream (overloaded version taking a stream-writable value)
template<typename U >
static void writeValue (std::ostream &stream, const U &value, typename boost::disable_if< boost::has_left_shift< std::ostream, const U & > >::type *=0)
 Write a message field value to a stream (overloaded version taking a non-stream-writable value)

Protected Attributes

std::string name
 The name of this message field.
value
 The value of this message field.

Detailed Description

template<typename T>
class variant_topic_tools::MessageField< T >

Message field template.

Definition at line 37 of file MessageField.h.


Constructor & Destructor Documentation

template<typename T>
variant_topic_tools::MessageField< T >::MessageField ( const std::string &  name = std::string(),
const T &  value = T() 
)

Default constructor.

template<typename T>
variant_topic_tools::MessageField< T >::MessageField ( const MessageField< T > &  src)

Copy constructor.

template<typename T>
virtual variant_topic_tools::MessageField< T >::~MessageField ( ) [virtual]

Destructor.


Member Function Documentation

template<typename T>
void variant_topic_tools::MessageField< T >::clear ( ) [virtual]

Clear the message field.

Reimplemented from variant_topic_tools::MessageFieldCollection< T >.

template<typename T>
const std::string& variant_topic_tools::MessageField< T >::getName ( ) const

Retrieve the name of the message field.

template<typename T>
T& variant_topic_tools::MessageField< T >::getValue ( )

Retrieve the value of the message field (non-const version)

template<typename T>
const T& variant_topic_tools::MessageField< T >::getValue ( ) const

Retrieve the value of the message field (const version)

template<typename T>
bool variant_topic_tools::MessageField< T >::isValid ( ) const

True, if this message field is valid.

template<typename T>
template<typename U >
static bool variant_topic_tools::MessageField< T >::isValid ( const U &  value,
typename boost::enable_if_c< MessageFieldTypeTraits::HasIsValid< U >::value >::type *  = 0 
) [static, protected]

True, if the message field is valid (overloaded version taking a field value which can be validated)

template<typename T>
template<typename U >
static bool variant_topic_tools::MessageField< T >::isValid ( const U &  value,
typename boost::disable_if_c< MessageFieldTypeTraits::HasIsValid< U >::value >::type *  = 0 
) [static, protected]

True, if the message field is valid (overloaded version taking a field value which cannot be validated)

template<typename T>
bool variant_topic_tools::MessageField< T >::operator!= ( const MessageField< T > &  field) const

True, if this message field is not equal to another message field.

template<typename T>
bool variant_topic_tools::MessageField< T >::operator== ( const MessageField< T > &  field) const

True, if this message field is equal to another message field.

template<typename T>
void variant_topic_tools::MessageField< T >::setName ( const std::string &  name)

Set the name of the message field.

template<typename T>
void variant_topic_tools::MessageField< T >::setValue ( const T &  value)

Set the value of the message field.

template<typename T>
void variant_topic_tools::MessageField< T >::write ( std::ostream &  stream,
const std::string &  indent = std::string() 
) const [virtual]

Write the message field to a stream.

Reimplemented from variant_topic_tools::MessageFieldCollection< T >.

template<typename T>
template<typename U >
static void variant_topic_tools::MessageField< T >::writeValue ( std::ostream &  stream,
const U &  value,
typename boost::enable_if< boost::has_left_shift< std::ostream, const U & > >::type *  = 0 
) [static, protected]

Write a message field value to a stream (overloaded version taking a stream-writable value)

template<typename T>
template<typename U >
static void variant_topic_tools::MessageField< T >::writeValue ( std::ostream &  stream,
const U &  value,
typename boost::disable_if< boost::has_left_shift< std::ostream, const U & > >::type *  = 0 
) [static, protected]

Write a message field value to a stream (overloaded version taking a non-stream-writable value)


Member Data Documentation

template<typename T>
std::string variant_topic_tools::MessageField< T >::name [protected]

The name of this message field.

Definition at line 98 of file MessageField.h.

template<typename T>
T variant_topic_tools::MessageField< T >::value [protected]

The value of this message field.

Definition at line 102 of file MessageField.h.


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


variant_topic_tools
Author(s): Ralf Kaestner
autogenerated on Fri Aug 5 2016 06:06:27