Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

TextMsgTrans Class Reference

Fires when a matching string is received. More...

#include <TextMsgTrans.h>

Inheritance diagram for TextMsgTrans:

Detailed Description

Fires when a matching string is received.

Definition at line 11 of file TextMsgTrans.h.

List of all members.

Public Member Functions

 TextMsgTrans (StateNode *destination, const std::string &message)
 default constructor, use type name as instance name
 TextMsgTrans (const std::string &name, StateNode *destination, const std::string &message)
 constructor with explicit instance name
 TextMsgTrans (const std::string &name, StateNode *destination)
 constructor with explicit instance name but no message; will match anything
virtual void preStart ()
 Called by start() before the doStart(), allows superclasses to do some initialization startup preceeding subclass customization.
virtual void doEvent ()
 Delegate function for event processing, the event itself is pointed to (only for the duration of the doEvent() call!) by event.
virtual std::string getDescription () const
 Gives a short description of what this particular instantiation does (in case a more specific description is needed on an individual basis).

Static Public Member Functions

static std::string getClassDescription ()
 Gives a short description of what this class of behaviors does... you should override this (but don't have to).

Protected Attributes

std::string msg
 the trigger to match messages against
bool haveMsg
 true if msg value was supplied in constructor
TextMsgEvent savedEvent
 copy of triggering event, used for reporting default match

Private Member Functions

 TextMsgTrans (const TextMsgTrans &)
 don't call (copy constructor)
TextMsgTransoperator= (const TextMsgTrans &)
 don't call (assignment operator)

Constructor & Destructor Documentation

TextMsgTrans::TextMsgTrans ( StateNode destination,
const std::string &  message 
)

default constructor, use type name as instance name

Definition at line 18 of file TextMsgTrans.h.

TextMsgTrans::TextMsgTrans ( const std::string &  name,
StateNode destination,
const std::string &  message 
)

constructor with explicit instance name

Definition at line 23 of file TextMsgTrans.h.

TextMsgTrans::TextMsgTrans ( const std::string &  name,
StateNode destination 
)

constructor with explicit instance name but no message; will match anything

Definition at line 28 of file TextMsgTrans.h.

TextMsgTrans::TextMsgTrans ( const TextMsgTrans  )  [private]

don't call (copy constructor)


Member Function Documentation

virtual void TextMsgTrans::doEvent (  )  [virtual]

Delegate function for event processing, the event itself is pointed to (only for the duration of the doEvent() call!) by event.

Default implementation watches for 'private' text message events (those forwarded by a BehaviorSwitchControl from ControllerGUI input) and will publically rebroadcast them. The idea is that your own processEvent gets first dibs, but if the behavior doesn't handle the text message, it will be handed off for others.

Reimplemented from BehaviorBase.

Definition at line 42 of file TextMsgTrans.h.

static std::string TextMsgTrans::getClassDescription (  )  [static]

Gives a short description of what this class of behaviors does... you should override this (but don't have to).

If you do override this, also consider overriding getDescription() to return it

Reimplemented from BehaviorBase.

Definition at line 74 of file TextMsgTrans.h.

Referenced by getDescription().

virtual std::string TextMsgTrans::getDescription (  )  const [virtual]

Gives a short description of what this particular instantiation does (in case a more specific description is needed on an individual basis).

By default simply returns getName(), because any calls from a BehaviorBase function to getClassDescription() are going to call BehaviorBase::getClassDescription(), not ~YourSubClass~getClassDescription(), because static functions can't be virtual in C++ (doh!)

This means that getDescription called on a pointer to a BehaviorBase of unknown subtype would always return an empty string, which is pretty useless. So instead we return the name in this situation. If you want getDescription to return getClassDescription, you'll have to override it in your subclass to do so.

Reimplemented from BehaviorBase.

Definition at line 75 of file TextMsgTrans.h.

TextMsgTrans& TextMsgTrans::operator= ( const TextMsgTrans  )  [private]

don't call (assignment operator)

virtual void TextMsgTrans::preStart (  )  [virtual]

Called by start() before the doStart(), allows superclasses to do some initialization startup preceeding subclass customization.

For robustness to future change, subclasses should be sure to call the superclass implementation.

Reimplemented from BehaviorBase.

Definition at line 37 of file TextMsgTrans.h.


Member Data Documentation

bool TextMsgTrans::haveMsg [protected]

true if msg value was supplied in constructor

Definition at line 83 of file TextMsgTrans.h.

Referenced by doEvent().

std::string TextMsgTrans::msg [protected]

the trigger to match messages against

Definition at line 82 of file TextMsgTrans.h.

Referenced by doEvent().

copy of triggering event, used for reporting default match

Definition at line 84 of file TextMsgTrans.h.

Referenced by doEvent().


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

Tekkotsu v5.1CVS
Generated Mon May 9 04:59:17 2016 by Doxygen 1.6.3