roviz  0.7
Code Documentation of roviz
Classes | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Message Class Reference

Used to send messages across streams. More...

#include <message.h>

Inheritance diagram for Message:
Inheritance graph
Collaboration diagram for Message:
Collaboration graph

Classes

struct  Entry
 An entry of a message. More...
 

Public Member Functions

 Message (const StreamObject &base)
 
 Message (std::initializer_list< SourceID > sources={})
 
const Entryentry (const std::string &name) const
 Get an entry of the message. More...
 
const Entryat (int index) const
 Get an entry of the message. More...
 
const Entryoperator[] (int index) const
 Get an entry of the message. More...
 
int size (void) const
 Get the size of a message. More...
 
- Public Member Functions inherited from StreamObject
SourceID id (void) const
 Get the SourceID of the object. More...
 

Static Public Member Functions

static StreamWidgetinitWidget (OutputPrivate *out)
 

Protected Attributes

MessagePrivate_this
 
- Protected Attributes inherited from StreamObject
std::shared_ptr< StreamObjectPrivate_this_base
 

Additional Inherited Members

- Protected Member Functions inherited from StreamObject
void initSources (std::initializer_list< SourceID > sources={})
 

Detailed Description

Used to send messages across streams.

This class provides an interface to send generic messages across streams. This could be useful for control signals or the like. It consists of a list of entries. Each entry has a name and a value. The type of the value can be either int, double or string.

See also
MessageMutable
MessagePrivate

Member Function Documentation

◆ at()

const Message::Entry & Message::at ( int  index) const

Get an entry of the message.

Parameters
indexThe index of the entry
Returns
The entry

This function checks the bounds and returns an invalid entry if the index is out of bounds.

◆ entry()

const Message::Entry & Message::entry ( const std::string &  name) const

Get an entry of the message.

Parameters
nameThe name of the entry
Returns
The first entry with a matching name

If name is not found in the message, an invalid entry is returned.

Here is the caller graph for this function:

◆ operator[]()

const Message::Entry & Message::operator[] ( int  index) const

Get an entry of the message.

Parameters
indexThe index of the entry
Returns
The entry

WARNING: This function doesn't check the bounds!

◆ size()

int Message::size ( void  ) const

Get the size of a message.

Returns
The amount of entries of this message

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