Fawkes API  Fawkes Development Version
fawkes::SwitchInterface::SetMessage Class Reference

SetMessage Fawkes BlackBoard Interface Message. More...

#include <>>

Inheritance diagram for fawkes::SwitchInterface::SetMessage:

Public Member Functions

 SetMessage (const bool ini_enabled, const float ini_value)
 Constructor with initial values. More...
 
 SetMessage ()
 Constructor. More...
 
 ~SetMessage ()
 Destructor. More...
 
 SetMessage (const SetMessage *m)
 Copy constructor. More...
 
bool is_enabled () const
 Get enabled value. More...
 
void set_enabled (const bool new_enabled)
 Set enabled value. More...
 
size_t maxlenof_enabled () const
 Get maximum length of enabled value. More...
 
float value () const
 Get value value. More...
 
void set_value (const float new_value)
 Set value value. More...
 
size_t maxlenof_value () const
 Get maximum length of value value. More...
 
virtual Messageclone () const
 Clone this message. More...
 
- Public Member Functions inherited from fawkes::Message
 Message (const char *type)
 Constructor. More...
 
 Message (const Message *mesg)
 Copy constructor. More...
 
 Message (const Message &mesg)
 Copy constructor. More...
 
virtual ~Message ()
 Destructor. More...
 
Messageoperator= (const Message &m)
 Assign this message to given message. More...
 
unsigned int id () const
 Get message ID. More...
 
void set_id (unsigned int message_id)
 Set message ID. More...
 
void mark_enqueued ()
 Mark message as being enqueued. More...
 
bool enqueued () const
 Check is message has been enqueued. More...
 
const Timetime_enqueued () const
 Get time when message was enqueued. More...
 
unsigned int sender_id () const
 Get ID of sender. More...
 
const char * sender_thread_name () const
 Get sender of message. More...
 
Interfaceinterface () const
 Get transmitting interface. More...
 
const char * type () const
 Get message type. More...
 
InterfaceFieldIterator fields ()
 Get iterator over all fields of this interface instance. More...
 
InterfaceFieldIterator fields_end ()
 Invalid iterator. More...
 
unsigned int num_fields () const
 Get the number of fields in the message. More...
 
const void * datachunk () const
 Get pointer to data. More...
 
unsigned int datasize () const
 Get size of data. More...
 
unsigned int hops () const
 Get number of hops. More...
 
void set_hops (unsigned int hops)
 Set number of hops. More...
 
void set_from_chunk (const void *chunk)
 Set from raw data chunk. More...
 
unsigned int recipient () const
 Get recipient memory serial. More...
 
template<class MessageType >
bool is_of_type ()
 Check if message has desired type. More...
 
template<class MessageType >
MessageType * as_type ()
 Cast message to given type if possible. More...
 
- Public Member Functions inherited from fawkes::RefCount
 RefCount ()
 Constructor. More...
 
virtual ~RefCount ()
 Destructor. More...
 
void ref ()
 Increment reference count. More...
 
void unref ()
 Decrement reference count and conditionally delete this instance. More...
 
unsigned int refcount ()
 Get reference count for this instance. More...
 

Additional Inherited Members

- Protected Member Functions inherited from fawkes::Message
void add_fieldinfo (interface_fieldtype_t type, const char *name, size_t length, void *value, const char *enumtype=0, const interface_enum_map_t *enum_map=0)
 Add an entry to the info list. More...
 
- Protected Attributes inherited from fawkes::Message
void * data_ptr
 Pointer to memory that contains local data. More...
 
unsigned int data_size
 Size of memory needed to hold all data. More...
 
message_data_ts_tdata_ts
 data timestamp aliasing pointer More...
 

Detailed Description

SetMessage Fawkes BlackBoard Interface Message.

Definition at line 80 of file SwitchInterface.h.

Constructor & Destructor Documentation

◆ SetMessage() [1/3]

fawkes::SwitchInterface::SetMessage::SetMessage ( const bool  ini_enabled,
const float  ini_value 
)

Constructor with initial values.

Parameters
ini_enabledinitial value for enabled
ini_valueinitial value for value

Definition at line 357 of file SwitchInterface.cpp.

References fawkes::Message::add_fieldinfo(), fawkes::Message::data_ptr, fawkes::Message::data_size, fawkes::Message::data_ts, fawkes::IFT_BOOL, and fawkes::IFT_FLOAT.

◆ SetMessage() [2/3]

fawkes::SwitchInterface::SetMessage::SetMessage ( )

◆ ~SetMessage()

fawkes::SwitchInterface::SetMessage::~SetMessage ( )

Destructor.

Definition at line 382 of file SwitchInterface.cpp.

References fawkes::Message::data_ptr.

◆ SetMessage() [3/3]

fawkes::SwitchInterface::SetMessage::SetMessage ( const SetMessage m)

Copy constructor.

Parameters
mmessage to copy from

Definition at line 390 of file SwitchInterface.cpp.

References fawkes::Message::data_ptr, fawkes::Message::data_size, and fawkes::Message::data_ts.

Member Function Documentation

◆ clone()

Message * fawkes::SwitchInterface::SetMessage::clone ( ) const
virtual

Clone this message.

Produces a message of the same type as this message and copies the data to the new message.

Returns
clone of this message

Reimplemented from fawkes::Message.

Definition at line 478 of file SwitchInterface.cpp.

◆ is_enabled()

bool fawkes::SwitchInterface::SetMessage::is_enabled ( ) const

Get enabled value.

True if the switch is currently enabled.

Returns
enabled value

Definition at line 407 of file SwitchInterface.cpp.

Referenced by PanTiltSonyEviD100PThread::loop(), and FawkesBeepDaemon::loop().

◆ maxlenof_enabled()

size_t fawkes::SwitchInterface::SetMessage::maxlenof_enabled ( ) const

Get maximum length of enabled value.

Returns
length of enabled value, can be length of the array or number of maximum number of characters for a string

Definition at line 417 of file SwitchInterface.cpp.

◆ maxlenof_value()

size_t fawkes::SwitchInterface::SetMessage::maxlenof_value ( ) const

Get maximum length of value value.

Returns
length of value value, can be length of the array or number of maximum number of characters for a string

Definition at line 453 of file SwitchInterface.cpp.

◆ set_enabled()

void fawkes::SwitchInterface::SetMessage::set_enabled ( const bool  new_enabled)

Set enabled value.

True if the switch is currently enabled.

Parameters
new_enablednew enabled value

Definition at line 429 of file SwitchInterface.cpp.

◆ set_value()

void fawkes::SwitchInterface::SetMessage::set_value ( const float  new_value)

Set value value.

If switches support multiple states these can be indicated with this value. For example for a switch that notes the intensity it could be a value in the valid range.

Parameters
new_valuenew value value

Definition at line 467 of file SwitchInterface.cpp.

◆ value()

float fawkes::SwitchInterface::SetMessage::value ( ) const

Get value value.

If switches support multiple states these can be indicated with this value. For example for a switch that notes the intensity it could be a value in the valid range.

Returns
value value

Definition at line 443 of file SwitchInterface.cpp.

Referenced by PanTiltSonyEviD100PThread::loop(), and FawkesBeepDaemon::loop().


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