driver_base::Driver Class Reference
#include <driver.h>
List of all members.
Detailed Description
State transition functions assume that they are called from the correct state. It is the caller's responsibility to check that the state is correct. The Driver mutex_ should always be locked by the caller before checking the current state and throughout the call to the transition function.
State should not change between calls to the transition function except for transitions from RUNNING to STOPPED. The device must hold its lock while doing this transition to allow the caller to enforce that stop is only called from the RUNNING state.
Transitions may fail. It is the caller's responsibility to check success by looking at the device's state_. After a failure, the device can set itself into any state. For example, if a call to start() fails, the device may end up in the CLOSED state.
Definition at line 61 of file driver.h.
Member Typedef Documentation
Constructor & Destructor Documentation
driver_base::Driver::Driver |
( |
|
) |
[inline] |
virtual driver_base::Driver::~Driver |
( |
|
) |
[inline, virtual] |
Member Function Documentation
void driver_base::Driver::clearRecoveryComplete |
( |
|
) |
[inline] |
bool driver_base::Driver::close |
( |
|
) |
[inline] |
virtual void driver_base::Driver::doClose |
( |
|
) |
[protected, pure virtual] |
virtual void driver_base::Driver::doOpen |
( |
|
) |
[protected, pure virtual] |
virtual void driver_base::Driver::doStart |
( |
|
) |
[protected, pure virtual] |
virtual void driver_base::Driver::doStop |
( |
|
) |
[protected, pure virtual] |
virtual std::string driver_base::Driver::getID |
( |
|
) |
[pure virtual] |
bool driver_base::Driver::getRecoveryComplete |
( |
|
) |
[inline] |
state_t driver_base::Driver::getState |
( |
|
) |
[inline] |
static const std::string& driver_base::Driver::getStateName |
( |
state_t |
s |
) |
[inline, static] |
const std::string driver_base::Driver::getStateName |
( |
|
) |
[inline] |
const std::string driver_base::Driver::getStatusMessage |
( |
|
) |
[inline] |
bool driver_base::Driver::getStatusOk |
( |
|
) |
[inline] |
const std::string& driver_base::Driver::getTransitionName |
( |
void(Driver::*)() |
transition |
) |
[inline, private] |
bool driver_base::Driver::goClosed |
( |
|
) |
[inline] |
bool driver_base::Driver::goOpened |
( |
|
) |
[inline] |
bool driver_base::Driver::goRunning |
( |
|
) |
[inline] |
bool driver_base::Driver::goState |
( |
state_t |
target |
) |
[inline] |
bool driver_base::Driver::isClosed |
( |
|
) |
[inline] |
bool driver_base::Driver::isOpened |
( |
|
) |
[inline] |
bool driver_base::Driver::isRunning |
( |
|
) |
[inline] |
bool driver_base::Driver::isStopped |
( |
|
) |
[inline] |
bool driver_base::Driver::lowerState |
( |
state_t |
target |
) |
[inline] |
bool driver_base::Driver::open |
( |
|
) |
[inline] |
bool driver_base::Driver::raiseState |
( |
state_t |
target |
) |
[inline] |
void driver_base::Driver::setPostOpenHook |
( |
hookFunction |
f |
) |
[inline] |
void driver_base::Driver::setStatusMessage |
( |
const std::string & |
msg, |
|
|
bool |
ok = false , |
|
|
bool |
recovery_complete = false | |
|
) |
| | [inline] |
void driver_base::Driver::setStatusMessagef |
( |
const char * |
format, |
|
|
|
... | |
|
) |
| | [inline] |
bool driver_base::Driver::start |
( |
|
) |
[inline] |
bool driver_base::Driver::stop |
( |
|
) |
[inline] |
bool driver_base::Driver::tryTransition |
( |
state_t |
target, |
|
|
void(Driver::*)() |
transition | |
|
) |
| | [inline, private] |
- Todo:
- print the exception message better.
Definition at line 283 of file driver.h.
Member Data Documentation
The documentation for this class was generated from the following file: