| Homepage | Demos | Overview | Downloads | Tutorials | Reference | Credits |
#include <CompareTrans.h>
Inheritance diagram for CompareTrans< T >:

You will need to specify an event mask which will be listened for. This event will then be listened for - each time it is received, CompareTrans will check the values for possible activation.
For example, if you want to transition when the IR sensor goes below, say 200, pass &state->sensors[IRDistOffset], CompareTrans::LT, 200, and EventBase(EventBase::sensorEGID,SensorSourceID::UpdatedSID,EventBase::statusETID) as the polling event. Or a timer event to just check at a certain interval.
If you pass a class as the templated type, only requires that < operator is defined for comparing inequality, == for equality, and a copy constructor (CompareTrans holds a protected copy of the value)
Passing NULL as the value to monitor will cause a transition on the first event received
Definition at line 25 of file CompareTrans.h.
Public Types | |
| enum | Test_t { LT, GT, LTE, GTE, EQ, NE } |
| use these values to sepecify what kind of comparison should be made to test for activation More... | |
Public Member Functions | |
| CompareTrans (StateNode *source, StateNode *destination, const T *monitor, Test_t test, const T &value, const EventBase &poll) | |
| constructor, see class notes for information | |
| virtual void | DoStart () |
| starts listening | |
| virtual void | DoStop () |
| stops listening | |
| virtual void | processEvent (const EventBase &) |
| don't care about the event, just a pulse to check the values | |
| virtual std::string | getName () const |
| Identifies the behavior in menus and such. | |
Protected Attributes | |
| const T * | mon |
| address of value to monitor | |
| Test_t | tst |
| test to make | |
| T | val |
| value to compare against | |
| EventBase | poller |
| event to listen to, when it comes, compare the values | |
Private Member Functions | |
| CompareTrans (const CompareTrans &node) | |
| don't call this | |
| CompareTrans | operator= (const CompareTrans &node) |
| don't call this | |
|
|||||
|
use these values to sepecify what kind of comparison should be made to test for activation
Definition at line 28 of file CompareTrans.h. |
|
||||||||||||||||||||||||||||||||
|
constructor, see class notes for information
Definition at line 38 of file CompareTrans.h. References CompareTrans< T >::mon, CompareTrans< T >::poller, CompareTrans< T >::tst, and CompareTrans< T >::val. |
|
||||||||||
|
don't call this
|
|
|||||||||
|
starts listening
Reimplemented from BehaviorBase. Reimplemented in SmoothCompareTrans< T >. Definition at line 43 of file CompareTrans.h. References EventRouter::addListener(), BehaviorBase::DoStart(), erouter, and CompareTrans< T >::poller. |
Here is the call graph for this function:

|
|||||||||
|
stops listening
Reimplemented from BehaviorBase. Definition at line 46 of file CompareTrans.h. References BehaviorBase::DoStop(), erouter, and EventRouter::forgetListener(). |
Here is the call graph for this function:

|
|||||||||
|
Identifies the behavior in menus and such.
Implements BehaviorBase. Reimplemented in SmoothCompareTrans< T >. Definition at line 72 of file CompareTrans.h. |
|
||||||||||
|
don't call this
|
|
||||||||||
|
don't care about the event, just a pulse to check the values
Reimplemented from BehaviorBase. Reimplemented in SmoothCompareTrans< T >. Definition at line 49 of file CompareTrans.h. References Transition::activate(), CompareTrans< T >::EQ, CompareTrans< T >::GT, CompareTrans< T >::GTE, CompareTrans< T >::LT, CompareTrans< T >::LTE, CompareTrans< T >::mon, CompareTrans< T >::NE, CompareTrans< T >::tst, and CompareTrans< T >::val. |
Here is the call graph for this function:

|
|||||
|
address of value to monitor
Definition at line 75 of file CompareTrans.h. |
|
|||||
|
event to listen to, when it comes, compare the values
Definition at line 78 of file CompareTrans.h. |
|
|||||
|
test to make
Definition at line 76 of file CompareTrans.h. |
|
|||||
|
value to compare against
Definition at line 77 of file CompareTrans.h. |
|
Tekkotsu v1.5 |
Generated Fri Oct 10 15:55:19 2003 by Doxygen 1.3.4 |