SMACC
|
#include <smacc_signal_detector.h>
Public Member Functions | |
SignalDetector (SmaccFifoScheduler *scheduler, ExecutionModel executionModel=ExecutionModel::SINGLE_THREAD_SPINNER) | |
void | initialize (ISmaccStateMachine *stateMachine) |
void | setProcessorHandle (SmaccFifoScheduler::processor_handle processorHandle) |
void | runThread () |
void | join () |
void | stop () |
void | pollingLoop () |
template<typename EventType > | |
void | postEvent (EventType *ev) |
void | notifyStateConfigured (ISmaccState *currentState) |
void | notifyStateExited (ISmaccState *currentState) |
Private Member Functions | |
void | pollOnce () |
void | findUpdatableClients () |
void | findUpdatableStateElements (ISmaccState *currentState) |
Private Attributes | |
ISmaccStateMachine * | smaccStateMachine_ |
std::vector< ISmaccUpdatable * > | updatableClients_ |
std::vector< std::vector< ISmaccUpdatable * > > | updatableStateElements_ |
std::atomic< uint64_t > | lastState_ |
double | loop_rate_hz |
std::atomic< bool > | end_ |
std::atomic< bool > | initialized_ |
ros::NodeHandle | nh_ |
ros::Publisher | statusPub_ |
SmaccFifoScheduler * | scheduler_ |
SmaccFifoScheduler::processor_handle | processorHandle_ |
boost::thread | signalDetectorThread_ |
ExecutionModel | executionModel_ |
Definition at line 22 of file smacc_signal_detector.h.
smacc::SignalDetector::SignalDetector | ( | SmaccFifoScheduler * | scheduler, |
ExecutionModel | executionModel = ExecutionModel::SINGLE_THREAD_SPINNER |
||
) |
SignalDetector()
Definition at line 18 of file signal_detector.cpp.
References loop_rate_hz, and scheduler_.
|
private |
Definition at line 45 of file signal_detector.cpp.
References smacc::introspection::demangleType(), smacc::ISmaccStateMachine::getOrthogonals(), smaccStateMachine_, and updatableClients_.
Referenced by initialize(), and pollOnce().
|
private |
findUpdatableClientBehaviors()
Definition at line 85 of file signal_detector.cpp.
References smacc::introspection::demangleType(), smacc::ISmaccState::getEventGenerators(), smacc::ISmaccStateMachine::getOrthogonals(), smacc::ISmaccState::getStateReactors(), smaccStateMachine_, and updatableStateElements_.
Referenced by notifyStateConfigured().
void smacc::SignalDetector::initialize | ( | ISmaccStateMachine * | stateMachine | ) |
Definition at line 32 of file signal_detector.cpp.
References findUpdatableClients(), initialized_, lastState_, and smaccStateMachine_.
Referenced by smacc::ISmaccStateMachine::ISmaccStateMachine().
void smacc::SignalDetector::join | ( | ) |
Definition at line 162 of file signal_detector.cpp.
References signalDetectorThread_.
void smacc::SignalDetector::notifyStateConfigured | ( | ISmaccState * | currentState | ) |
Definition at line 177 of file signal_detector.cpp.
References findUpdatableStateElements().
Referenced by smacc::ISmaccStateMachine::notifyOnRuntimeConfigurationFinished().
void smacc::SignalDetector::notifyStateExited | ( | ISmaccState * | currentState | ) |
Definition at line 182 of file signal_detector.cpp.
References updatableStateElements_.
Referenced by smacc::ISmaccStateMachine::notifyOnStateExited().
void smacc::SignalDetector::pollingLoop | ( | ) |
Definition at line 267 of file signal_detector.cpp.
References smacc::utils::cleanShortTypeName(), end_, executionModel_, initialized_, loop_rate_hz, pollOnce(), smacc::SINGLE_THREAD_SPINNER, and smaccStateMachine_.
Referenced by smacc::run(), and runThread().
|
private |
poll()
Definition at line 193 of file signal_detector.cpp.
References smacc::introspection::demangleType(), findUpdatableClients(), smacc::ISmaccStateMachine::lockStateMachine(), smaccStateMachine_, smacc::STATE_CONFIGURING, smacc::STATE_ENTERING, smacc::STATE_EXITING, smacc::ISmaccStateMachine::stateMachineCurrentAction, smacc::TRANSITIONING, smacc::ISmaccStateMachine::unlockStateMachine(), updatableClients_, and updatableStateElements_.
Referenced by pollingLoop().
|
inline |
Definition at line 42 of file smacc_signal_detector.h.
References processorHandle_, and scheduler_.
Referenced by smacc::ISmaccStateMachine::postEvent().
void smacc::SignalDetector::runThread | ( | ) |
Definition at line 152 of file signal_detector.cpp.
References pollingLoop(), and signalDetectorThread_.
void smacc::SignalDetector::setProcessorHandle | ( | SmaccFifoScheduler::processor_handle | processorHandle | ) |
Definition at line 142 of file signal_detector.cpp.
References processorHandle_.
Referenced by smacc::run().
void smacc::SignalDetector::stop | ( | ) |
Definition at line 172 of file signal_detector.cpp.
References end_.
|
private |
Definition at line 69 of file smacc_signal_detector.h.
Referenced by pollingLoop(), and stop().
|
private |
Definition at line 85 of file smacc_signal_detector.h.
Referenced by pollingLoop().
|
private |
Definition at line 71 of file smacc_signal_detector.h.
Referenced by initialize(), and pollingLoop().
|
private |
Definition at line 61 of file smacc_signal_detector.h.
Referenced by initialize().
|
private |
Definition at line 67 of file smacc_signal_detector.h.
Referenced by pollingLoop(), and SignalDetector().
|
private |
Definition at line 73 of file smacc_signal_detector.h.
|
private |
Definition at line 81 of file smacc_signal_detector.h.
Referenced by postEvent(), and setProcessorHandle().
|
private |
Definition at line 79 of file smacc_signal_detector.h.
Referenced by postEvent(), and SignalDetector().
|
private |
Definition at line 83 of file smacc_signal_detector.h.
Referenced by join(), and runThread().
|
private |
Definition at line 55 of file smacc_signal_detector.h.
Referenced by findUpdatableClients(), findUpdatableStateElements(), initialize(), pollingLoop(), and pollOnce().
|
private |
Definition at line 75 of file smacc_signal_detector.h.
|
private |
Definition at line 57 of file smacc_signal_detector.h.
Referenced by findUpdatableClients(), and pollOnce().
|
private |
Definition at line 59 of file smacc_signal_detector.h.
Referenced by findUpdatableStateElements(), notifyStateExited(), and pollOnce().