5 #ifndef __RD_MOCK_STATE_HPP__
6 #define __RD_MOCK_STATE_HPP__
8 #include <yarp/os/PortReader.h>
9 #include <yarp/os/RpcServer.h>
10 #include <yarp/os/ConnectionReader.h>
26 class MockState :
public State,
public yarp::os::PortReader,
public yarp::os::RpcServer
46 virtual bool read(yarp::os::ConnectionReader & connection);
65 int internal_variable;
73 #endif // __RD_MOCK_STATE_HPP__
static const int STATE_INITIAL
Indicates that the State has been initialized.
Definition: MockState.hpp:49
The main, catch-all namespace for Robot Devastation.
Definition: groups.dox:4
virtual bool cleanup()
Sets an internal variable indicating that this function has been called.
Definition: MockState.cpp:63
int state_history
Bitmask that stores the execution flow stages this State has passed through.
Definition: MockState.hpp:68
static const int REQUEST_STATE
Request identifier for RPC communication.
Definition: MockState.hpp:61
static const int STATE_LOOP
Indicates that the State has called loop()
Definition: MockState.hpp:55
Base class for each of the states of a FiniteStateMachine.
Definition: State.hpp:18
virtual bool setup()
Sets an internal variable indicating that this function has been called.
Definition: MockState.cpp:41
MockState(int id)
Creates a MockState and assigns it an id.
Definition: MockState.cpp:22
virtual bool read(yarp::os::ConnectionReader &connection)
Reads an incoming message that changes the internal state of the State.
Definition: MockState.cpp:78
virtual bool loop()
Sets an internal variable indicating that this function has been called.
Definition: MockState.cpp:51
Dummy State for testing.
Definition: MockState.hpp:26
static const int STATE_CLEANUP
Indicates that the State has called cleanup()
Definition: MockState.hpp:58
static const int STATE_SETUP
Indicates that the State has called setup()
Definition: MockState.hpp:52
virtual int evaluateConditions()
Returns the internal variable value as condition evaluation result.
Definition: MockState.cpp:73