iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nrt::Message< T > Class Template Reference

#include <nrt/Core/Blackboard/Message.H>

template<class T>
class nrt::Message< T >

Generic message template that contains one value.

The template argument can be anything that is serializable. Beware that the internal name used by the Blackboard for this message is whatever the compiler thinks the message is, so, for example, avoid Message<nrt::byte> since the compiler calls that a Message<unsigned char>. You can use nrt::MessageType() to check out how the compiler calls one of your types after it substitutes various typedefs and such.

Examples:
tests/test-ResultsSyntax.C, and tests/test-split-messages.C.

Definition at line 218 of file Message.H.

Inheritance diagram for nrt::Message< T >:
nrt::MessageBase nrt::MessageTypesCreator< Message< T > >

Public Member Functions

 Message ()
 Construct this Message with a default value.
 
 Message (T const &val)
 Construct this Message with a copy of a value.
 
 Message (std::shared_ptr< T > val)
 Construct this Message from an existing shared_ptr to a value.
 
virtual ~Message ()
 Destructor.
 
T & value ()
 Access the value, read/write. More...
 
T const & value () const
 Access the value, read-only. More...
 
std::shared_ptr< T > valuePtr ()
 Access the value shared_ptr, read/write.
 
std::shared_ptr< T const > valuePtr () const
 Access the value, read-only.
 
- Public Member Functions inherited from nrt::MessageBase
 MessageBase ()
 Constructor.
 
virtual ~MessageBase ()
 Virtual destructor for safe inheritance.
 
virtual std::string description () const
 A short description of the Message type. More...
 

Protected Member Functions

template<class Archive >
void serialize (Archive &ar)
 Serialization.
 

Friends

class cereal::access
 
template<class Typ , bool ISMSG>
class SplitMessageSubscriber
 

Additional Inherited Members

- Public Types inherited from nrt::MessageTypesCreator< Message< T > >
typedef std::shared_ptr
< Message< T >const > 
const_ptr
 A shared constant pointer to this message type (messages are always received as this type)
 
typedef std::unique_ptr
< Message< T > > 
unique_ptr
 A shared unique pointer to this message type (messages are always sent and returned as this type)
 
- Static Public Attributes inherited from nrt::MessageBase
static bool const isComposite = false
 Is this message composite and can it be split into parts? More...
 

Member Function Documentation

template<class T >
T & nrt::Message< T >::value ( )
inline

Access the value, read/write.

Note that doing an assignment here will do a deep copy of the value; use valuePtr() to access a shared_ptr to the value instead.

Definition at line 102 of file MessageImpl.H.

template<class T >
T const & nrt::Message< T >::value ( ) const
inline

Access the value, read-only.

Note that doing an assignment here will do a deep copy of the value; use valuePtr() to access a shared_ptr to the value instead.

Definition at line 106 of file MessageImpl.H.


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