Public Member Functions | Public Attributes | List of all members
StatesTC Class Reference
Inheritance diagram for StatesTC:
Inheritance graph
[legend]

Public Member Functions

bool breakUpdateHook ()
 
void cleanupHook ()
 
bool configureHook ()
 
void errorHook ()
 
void exceptionHook ()
 
void resetFlags ()
 
bool startHook ()
 
 StatesTC ()
 
void stopHook ()
 
void updateHook ()
 
- Public Member Functions inherited from RTT::TaskContext
virtual void clear ()
 
base::ActivityInterfacegetActivity ()
 
template<typename T >
T * getActivity ()
 
virtual const std::string & getName () const
 
virtual bool ready ()
 
bool setActivity (base::ActivityInterface *new_act)
 
virtual bool start ()
 
virtual bool stop ()
 
 TaskContext (const std::string &name, TaskState initial_state=Stopped)
 
virtual ~TaskContext ()
 
virtual bool addPeer (TaskContext *peer, std::string alias="")
 
virtual void removePeer (const std::string &name)
 
virtual void removePeer (TaskContext *peer)
 
virtual bool connectPeers (TaskContext *peer)
 
virtual void disconnect ()
 
virtual void disconnectPeers (const std::string &name)
 
virtual PeerList getPeerList () const
 
virtual bool hasPeer (const std::string &peer_name) const
 
virtual TaskContextgetPeer (const std::string &peer_name) const
 
Service::shared_ptr provides ()
 
Service::shared_ptr provides (const std::string &service_name)
 
ServiceRequester::shared_ptr requires ()
 
ServiceRequester::shared_ptr requires (const std::string &service_name)
 
virtual bool connectServices (TaskContext *peer)
 
template<class ServiceType >
boost::shared_ptr< ServiceType > getProvider (const std::string &name)
 
bool loadService (const std::string &service_name)
 
template<class Signature >
Operation< Signature > & addOperation (Operation< Signature > &op)
 
template<class Func , class Service >
Operation< typename internal::GetSignature< Func >::Signature > & addOperation (const std::string name, Func func, Service *serv, ExecutionThread et=ClientThread)
 
template<class Signature >
Operation< Signature > & addOperation (const std::string name, Signature *func, ExecutionThread et=ClientThread)
 
OperationInterfacePartgetOperation (std::string name)
 
OperationInterfaceoperations ()
 
template<class T >
bool addAttribute (const std::string &name, T &attr)
 
template<class T >
bool addConstant (const std::string &name, const T &attr)
 
bool addAttribute (base::AttributeBase &a)
 
base::AttributeBasegetAttribute (const std::string &name) const
 
ConfigurationInterfaceattributes ()
 
template<class T >
Property< T > & addProperty (const std::string &name, T &attr)
 
bool addProperty (base::PropertyBase &pb)
 
base::PropertyBasegetProperty (const std::string &name) const
 
PropertyBagproperties ()
 
base::PortInterfaceaddPort (const std::string &name, base::PortInterface &port)
 
base::PortInterfaceaddPort (base::PortInterface &port)
 
base::InputPortInterfaceaddEventPort (const std::string &name, base::InputPortInterface &port, SlotFunction callback=SlotFunction())
 
base::InputPortInterfaceaddEventPort (base::InputPortInterface &port, SlotFunction callback=SlotFunction())
 
base::PortInterfacegetPort (const std::string &name) const
 
DataFlowInterfaceports ()
 
const DataFlowInterfaceports () const
 
virtual bool connectPorts (TaskContext *peer)
 
- Public Member Functions inherited from RTT::base::TaskCore
const ExecutionEngineengine () const
 
ExecutionEngineengine ()
 
unsigned int getCycleCounter () const
 
unsigned int getIOCounter () const
 
virtual TaskState getTargetState () const
 
virtual TaskState getTaskState () const
 
unsigned int getTimeOutCounter () const
 
unsigned int getTriggerCounter () const
 
 TaskCore (TaskState initial_state=Stopped, const std::string &name=std::string())
 
virtual ~TaskCore ()
 
virtual bool configure ()
 
virtual bool activate ()
 
virtual bool cleanup ()
 
virtual bool isConfigured () const
 
virtual bool isActive () const
 
virtual bool isRunning () const
 
virtual Seconds getPeriod () const
 
virtual bool setPeriod (Seconds s)
 
virtual unsigned getCpuAffinity () const
 
virtual bool setCpuAffinity (unsigned cpu)
 
virtual bool inFatalError () const
 
virtual bool inException () const
 
virtual bool inRunTimeError () const
 
virtual bool update ()
 
virtual bool trigger ()
 
virtual void error ()
 
virtual bool recover ()
 

Public Attributes

bool didbreakUH
 
bool didcleanup
 
bool didconfig
 
bool diderror
 
bool didexcept
 
bool didstart
 
bool didstop
 
bool didupdate
 
bool do_block
 
bool do_breakUH
 
bool do_checks
 
bool do_error
 
bool do_fatal
 
bool do_stop
 
bool do_throw
 
bool do_throw2
 
bool do_throw3
 
bool do_trigger
 
int updatecount
 
bool validconfig
 
bool validstart
 

Additional Inherited Members

- Public Types inherited from RTT::TaskContext
typedef std::vector< std::string > PeerList
 
typedef boost::function< void(base::PortInterface *)> SlotFunction
 
- Public Types inherited from RTT::base::TaskCore
enum  TaskState {
  Init, PreOperational, FatalError, Exception,
  Stopped, Running, RunTimeError
}
 
- Protected Member Functions inherited from RTT::TaskContext
virtual void dataOnPortCallback (base::PortInterface *port)
 
virtual bool dataOnPortHook (base::PortInterface *port)
 
void forceActivity (base::ActivityInterface *new_act)
 
- Protected Member Functions inherited from RTT::base::TaskCore
virtual void exception ()
 
virtual void fatal ()
 
- Protected Attributes inherited from RTT::base::TaskCore
ExecutionEngineee
 
unsigned int mCycleCounter
 
unsigned int mIOCounter
 
std::string mName
 
TaskState mTaskState
 
unsigned int mTimeOutCounter
 
unsigned int mTriggerCounter
 
bool mTriggerOnStart
 

Detailed Description

Definition at line 41 of file taskstates_test.cpp.

Constructor & Destructor Documentation

StatesTC::StatesTC ( )
inline

Definition at line 45 of file taskstates_test.cpp.

Member Function Documentation

bool StatesTC::breakUpdateHook ( )
inlinevirtual

Implement this function if your code might block for long times inside the updateHook() function. Insert in this hook the code to wake up that code or signal it otherwise that updateHook() is requested to return (for example by setting a flag). The method returns false by default.

Returns
true if well received and updateHook() will soon return. False otherwise.

Reimplemented from RTT::base::TaskCore.

Definition at line 147 of file taskstates_test.cpp.

void StatesTC::cleanupHook ( )
inlinevirtual

Implement this method such that it contains the code which will be executed when cleanup() is called. The default implementation is an empty function.

Reimplemented from RTT::base::TaskCore.

Definition at line 106 of file taskstates_test.cpp.

bool StatesTC::configureHook ( )
inlinevirtual

Implement this method such that it contains the code which will be executed when configure() is called. The default implementation is an empty function which returns true.

Return values
trueto indicate that configuration succeeded and the Stopped state may be entered.
falseto indicate that configuration failed and the Preoperational state is entered.

Reimplemented from RTT::base::TaskCore.

Definition at line 80 of file taskstates_test.cpp.

void StatesTC::errorHook ( )
inlinevirtual

Implement this method to contain code that must be executed in the RunTimeError state, instead of updateHook(). This allows you to specify the behaviour in an erroneous component. errorHook() is called as long as the component is not recover()'ed. After recover()'ed, the updateHook() is called again.

Reimplemented from RTT::base::TaskCore.

Definition at line 152 of file taskstates_test.cpp.

void StatesTC::exceptionHook ( )
inlinevirtual

Implement this method to contain code that must be executed when transitioning to the Exception state. This allows you to specify the last actions in an erroneous component, after stopHook() and cleanupHook() were called.

See also
recover() to leave the Exception state.

Reimplemented from RTT::base::TaskCore.

Definition at line 114 of file taskstates_test.cpp.

void StatesTC::resetFlags ( )
inline

Definition at line 66 of file taskstates_test.cpp.

bool StatesTC::startHook ( )
inlinevirtual

Implement this method such that it contains the code which will be executed when start() is called. The default implementation is an empty function which returns true.

Return values
trueto indicate that the component may run and the Running state may be entered.
falseto indicate that the component may not run and the Stopped state is entered.

Reimplemented from RTT::base::TaskCore.

Definition at line 89 of file taskstates_test.cpp.

void StatesTC::stopHook ( )
inlinevirtual

Implement this method such that it contains the code which will be executed when stop() is called. The default implementation is an empty function.

Reimplemented from RTT::base::TaskCore.

Definition at line 98 of file taskstates_test.cpp.

void StatesTC::updateHook ( )
inlinevirtual

Function where the user must insert his 'application' code. When the ExecutionEngine's Activity is a periodic, this function is called by the ExecutionEngine in each periodic step after all messages are processed. When it is executed by a non periodic activity, this function is called after a message is received and executed. It should not loop forever, since no commands or events are processed when this function executes. The default implementation is an empty function.

Reimplemented from RTT::base::TaskCore.

Definition at line 124 of file taskstates_test.cpp.

Member Data Documentation

bool StatesTC::didbreakUH

Definition at line 168 of file taskstates_test.cpp.

bool StatesTC::didcleanup

Definition at line 167 of file taskstates_test.cpp.

bool StatesTC::didconfig

Definition at line 164 of file taskstates_test.cpp.

bool StatesTC::diderror

Definition at line 168 of file taskstates_test.cpp.

bool StatesTC::didexcept

Definition at line 168 of file taskstates_test.cpp.

bool StatesTC::didstart

Definition at line 165 of file taskstates_test.cpp.

bool StatesTC::didstop

Definition at line 166 of file taskstates_test.cpp.

bool StatesTC::didupdate

Definition at line 168 of file taskstates_test.cpp.

bool StatesTC::do_block

Definition at line 169 of file taskstates_test.cpp.

bool StatesTC::do_breakUH

Definition at line 169 of file taskstates_test.cpp.

bool StatesTC::do_checks

Definition at line 169 of file taskstates_test.cpp.

bool StatesTC::do_error

Definition at line 169 of file taskstates_test.cpp.

bool StatesTC::do_fatal

Definition at line 169 of file taskstates_test.cpp.

bool StatesTC::do_stop

Definition at line 169 of file taskstates_test.cpp.

bool StatesTC::do_throw

Definition at line 169 of file taskstates_test.cpp.

bool StatesTC::do_throw2

Definition at line 169 of file taskstates_test.cpp.

bool StatesTC::do_throw3

Definition at line 169 of file taskstates_test.cpp.

bool StatesTC::do_trigger

Definition at line 169 of file taskstates_test.cpp.

int StatesTC::updatecount

Definition at line 170 of file taskstates_test.cpp.

bool StatesTC::validconfig

Definition at line 164 of file taskstates_test.cpp.

bool StatesTC::validstart

Definition at line 165 of file taskstates_test.cpp.


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


rtt
Author(s): RTT Developers
autogenerated on Tue Jun 25 2019 19:33:40