#include <rtt/corba/ControlTaskProxy.hpp>

Definition at line 75 of file ControlTaskProxy.hpp.
Public Types | |
|
typedef std::map < ControlTaskProxy *, Corba::ControlTask_ptr > | PMap |
| typedef std::vector< std::string > | PeerList |
| A list of Peer TaskContext names. | |
| typedef std::vector< std::string > | ObjectList |
| A list of all child objects of this interface. | |
| enum | TaskState { Init, PreOperational, FatalError, Stopped, Active, Running, RunTimeWarning, RunTimeError } |
| Describes the different states a component can have. More... | |
Public Member Functions | |
| Corba::ControlTask_ptr | server () const |
| Get the Corba Object of the ControlTask. | |
| virtual bool | activate () |
| This method starts the execution of this component in order to process events and commands. | |
| virtual bool | start () |
| This method starts the execution engine of this component (if not already running) and executes the updateHook() with each period. | |
| virtual bool | stop () |
| This method stops the execution engine of this component. | |
| virtual bool | isRunning () const |
| Inspect if the component is in the Running, RunTimeWarning or RunTimeError state. | |
| virtual bool | configure () |
| This method instructs the component to (re-)read configuration data and try to enter the Stopped state. | |
| virtual bool | cleanup () |
| This method instructs a stopped component to enter the pre-operational state again. | |
| virtual bool | resetError () |
| If the component entered the FatalError state, call this method to recover. | |
| virtual bool | isActive () const |
| Inspect if the component is processing events, i.e. | |
| virtual bool | isConfigured () const |
| Inspect if the component is configured, i.e. | |
| virtual bool | inFatalError () const |
| Inspect if the component is in the FatalError state. | |
| virtual bool | inRunTimeWarning () const |
| Inspect if the component is in the RunTimeWarning state. | |
| virtual bool | inRunTimeError () const |
| Inspect if the component is in the RunTimeError state. | |
| virtual int | getErrorCount () const |
| Returns the number of times the RunTimeError state was entered. | |
| virtual int | getWarningCount () const |
| Returns the number of times the RunTimeWarning state was entered. | |
| virtual TaskState | getTaskState () const |
| Returns the current state of the TaskContext. | |
| virtual void | setName (const std::string &n) |
| Change the name of this TaskCore. | |
| virtual bool | addPeer (TaskContext *peer, std::string alias="") |
| Add a one-way connection from this task to a peer task. | |
| virtual void | removePeer (const std::string &name) |
| Remove a one-way connection from this task to a peer task. | |
| virtual void | removePeer (TaskContext *peer) |
| Remove a one-way connection from this task to a peer task. | |
| virtual bool | connectPeers (TaskContext *peer) |
| Add a two-way connection from this task to a peer task. | |
| virtual void | disconnectPeers (const std::string &name) |
| Remove a two-way connection from this task to a peer task. | |
| virtual PeerList | getPeerList () const |
| Return a standard container which contains all the Peer names of this TaskContext. | |
| virtual bool | hasPeer (const std::string &peer_name) const |
| Return true if it knows a peer by that name. | |
| virtual TaskContext * | getPeer (const std::string &peer_name) const |
| Get a pointer to a peer of this task. | |
| virtual bool | connectPorts (TaskContext *peer) |
| Add a data flow connection from this task's ports to a peer's ports. | |
| virtual bool | ready () |
| Checks the validity of this TaskContext. | |
| virtual const std::string & | getName () const |
| Returns the name of this interface. | |
| virtual const std::string & | getDescription () const |
| Returns the description of this interface. | |
| virtual void | setDescription (const std::string &descr) |
| virtual OperationInterface * | getParent () |
| Returns the parent OperationInterface in which this TaskObject lives. | |
| virtual void | setParent (OperationInterface *) |
| This method is ignored by the TaskContext. | |
| virtual void | setEngine (ExecutionEngine *) |
| This method is ignored by the TaskContext. | |
| void | exportPorts () |
| Call this function to force a TaskContext to export its Data Flow ports as scripting objects. | |
| virtual void | disconnect () |
| Disconnect this TaskContext from it's peers. | |
| virtual void | reconnect () |
| Reconnect the data ports of this task, without removing the peer relationship. | |
| virtual bool | addObject (OperationInterface *obj) |
| Add a new TaskObject to this TaskContext. | |
| virtual void | clear () |
| Clear the complete interface of this Component. | |
| ScriptingAccess * | scripting () |
| Get access to high level controls for programs, state machines and scripting statements. | |
| const ScriptingAccess * | scripting () const |
| Get access to high level controls for programs, state machines and scripting statements. | |
| ExecutionAccess * | execution () |
| Get access to high level controls for controlling programs and state machines. | |
| const ExecutionAccess * | execution () const |
| Get access to high level controls for controlling programs and state machines. | |
| MarshallingAccess * | marshalling () |
| Get access to high level controls for (de)serializing properties to/from an XML format. | |
| const MarshallingAccess * | marshalling () const |
| Get access to high level controls for (de)serializing properties to/from an XML format. | |
| PropertyBag * | properties () |
| The properties of this TaskContext. | |
| const PropertyBag * | properties () const |
| The properties of this TaskContext. | |
| DataFlowInterface * | ports () |
| Get the Data flow ports of this task. | |
| const DataFlowInterface * | ports () const |
| Get the Data flow ports of this task. | |
| CommandRepository * | commands () |
| Returns the commands of this interface. | |
| const CommandRepository * | commands () const |
| MethodRepository * | methods () |
| Returns the methods of this interface. | |
| const MethodRepository * | methods () const |
| EventService * | events () |
| The task-local events ( 'signals' ) of this TaskContext. | |
| const EventService * | events () const |
| The task-local events ( 'signals' ) of this TaskContext. | |
| AttributeRepository * | attributes () |
| Returns the attributes of this interface. | |
| const AttributeRepository * | attributes () const |
| virtual OperationInterface * | getObject (const std::string &obj_name) |
| Get a pointer to a previously added TaskObject. | |
| virtual ObjectList | getObjectList () const |
| Get a list of all the object names of this interface. | |
| virtual bool | removeObject (const std::string &obj_name) |
| Remove and delete a previously added TaskObject. | |
| void | setExecutionEngine (ExecutionEngine *engine) |
| Use this method to re-set the execution engine of this task core. | |
| const ExecutionEngine * | engine () const |
| Get a const pointer to the ExecutionEngine of this Task. | |
| ExecutionEngine * | engine () |
| Get a pointer to the ExecutionEngine of this Task. | |
Script Methods | |
These TaskCore functions are exported in a TaskContext as script methods and are for configuration, starting and stopping its ExecutionEngine. | |
| virtual double | getPeriod () const |
| Get the configured execution period of this component. | |
| virtual bool | doUpdate () |
| Invoke this method to execute the ExecutionEngine and the update() method. | |
| virtual bool | doTrigger () |
| Invoke this method to trigger the thread of this TaskContext to execute its ExecutionEngine and the update() method. | |
Static Public Member Functions | |
| static bool | InitOrb (int argc, char *argv[]) |
| Invoke this method once to initialise the Orb which will connect to the task servers. | |
| static void | DestroyOrb () |
| Invoke this method once to cleanup the orb. | |
| static ControlTaskProxy * | Create (std::string name, bool is_ior=false) |
| Factory method: create a CORBA Proxy for an existing ControlTaskServer. | |
| static TaskContext * | Create (::RTT::Corba::ControlTask_ptr task) |
| Factory method: create a CORBA Proxy for an existing ControlTaskServer. | |
| static PortableServer::POA_ptr | ProxyPOA () |
| Returns the default POA for all proxies. | |
Static Public Attributes | |
| static PMap | proxies |
| static CORBA::ORB_var | orb |
| The orb of this process. | |
| static PortableServer::POA_var | rootPOA |
| The root POA of this process. | |
Protected Types | |
|
typedef std::map< std::string, TaskContext * > | PeerMap |
|
typedef std::vector < TaskContext * > | Users |
|
typedef std::vector < OperationInterface * > | Objects |
Protected Member Functions | |
| ControlTaskProxy (std::string location, bool is_ior) | |
| Private constructor which creates a new connection to a stringified ior or taskname in NameServer. | |
| ControlTaskProxy (::RTT::Corba::ControlTask_ptr t) | |
| Private constructor which creates a new connection to a corba object. | |
| void | synchronizeOnce () |
| void | synchronize () |
| void | fetchObjects (OperationInterface *parent, ControlObject_ptr mtask) |
| void | addUser (TaskContext *user) |
| Inform this TaskContext that user is using our services. | |
| void | removeUser (TaskContext *user) |
| Inform this TaskContext that user is no longer using our services. | |
| void | setup () |
| virtual bool | configureHook () |
| Implement this method such that it contains the code which will be executed when configure() is called. | |
| virtual void | cleanupHook () |
| Implement this method such that it contains the code which will be executed when cleanup() is called. | |
| virtual bool | activateHook () |
| Implement this method such that it contains the code which will be executed when activate() is called. | |
| virtual bool | startHook () |
| Implement this method such that it contains the code which will be executed when start() is called. | |
| virtual bool | startup () |
| Function where the user must insert his 'startup' code. | |
| virtual void | updateHook () |
| Function where the user must insert his 'application' code. | |
| virtual void | errorHook () |
| Implement this method to contain code that must be executed in the RunTimeError state, instead of updateHook(). | |
| virtual void | update () |
| Function where the user must insert his 'application' code. | |
| virtual void | stopHook () |
| Implement this method such that it contains the code which will be executed when stop() is called. | |
| virtual void | shutdown () |
| Function where the user must insert his 'shutdown' code. | |
| virtual bool | resetHook () |
| Implement this method to recover from the FatalError state. | |
| virtual void | warning () |
| Call this method in a Running state to indicate a run-time warning condition. | |
| virtual void | error () |
| Call this method in a Running state to indicate a run-time error condition. | |
| virtual void | fatal () |
| Call this method from any place to indicate that this component encountered a fatal error. | |
| virtual void | recovered () |
| Call this method in a Running state to indicate that the run-time warning or error conditions are gone and nominal operation is resumed. | |
Protected Attributes | |
| Corba::ControlTask_var | mtask |
| std::string | mdescription |
| PeerMap | _task_map |
| map of the tasks we are using | |
| Users | musers |
| map of the tasks that are using us. | |
| Objects | mobjects |
| the TaskObjects. | |
| ScriptingAccess * | mscriptAcc |
| ExecutionAccess * | mengAcc |
| MarshallingAccess * | marshAcc |
| CommandRepository | mcommands |
| MethodRepository | mmethods |
| AttributeRepository | mattributes |
| std::string | mtask_name |
| ExecutionEngine * | ee |
| The execution engine which calls update() and processes our commands, events etc. | |
| TaskState | mTaskState |
| int | runtime_warnings |
| int | runtime_errors |
Static Protected Attributes | |
| static PortableServer::POA_var | proxy_poa |
| For now one POA handles all proxies. | |
Friends | |
| class | ExecutionEngine |
enum TaskState [inherited] |
Describes the different states a component can have.
When a TaskContext is being constructed, it is in the Init state. After the construction ends, the component arrives in the PreOperational (additional configuration required) or the Stopped (ready to run) state. Invoking start() will make a transition to the Running state and stop() back to the Stopped state. The Running state executes the updateHook() and processes events and commands. Invoking activate() will make a transition to the Active state in which only events and commands are processed. Within the Active state: start() will continue to the Running state, and a stop() will go back to the Stopped state. Finally, there is an FatalError state, in which the component can enter by calling the protected method fatalError(). In this state, the ExecutionEngine is stopped and updateHook() is no longer called. The public resetError() method allows one to leave the FatalError state and enter the Stopped state, or if the error is unrecoverable, the PreOperational state.
Next to the fatal error, two run-time error levels are available in the Running state as well. These levels allow 'automatic' recovery by the component in case the problem is temporal. When the task is Running, it may call the protected warning() method in order to signal a possible problem. In this RunTimeWarning substate, the updateHook() is still called. One can leave this substate by calling the protected recovered() method. In case of more severe problems, one may call the protected method error() when the component is Running. The component will enter the RunTimeError state and will cause the errorHook() to be called instead of updateHook(). When recovered() is called, this run-time error state is left and the nominal Running state is entered again.
In order to keep track of these run-time errors, a counter is provided for each sub-state indicating how many times it was entered. See getWarningCount() and getErrorCount().
In order to check if these transitions are allowed, hook functions are executed, which can be filled in by the component builder.
Definition at line 131 of file TaskCore.hpp.
| ControlTaskProxy * Create | ( | std::string | name, | |
| bool | is_ior = false | |||
| ) | [static] |
Factory method: create a CORBA Proxy for an existing ControlTaskServer.
| name | The name of the ControlTaskServer to connect to or the Object Reference of the object to connect to | |
| is_ior | set to true if name is an IOR. Defaults to false. |
| 0 | if the ORB is not initialised |
Definition at line 448 of file ControlTaskProxy.cpp.
References ControlTaskProxy::ControlTaskProxy(), ApplicationServer::orb, and IllegalServer::what().
Referenced by ControlTaskProxy::getPeer().
| TaskContext * Create | ( | ::RTT::Corba::ControlTask_ptr | task | ) | [static] |
Factory method: create a CORBA Proxy for an existing ControlTaskServer.
This method may in fact return the real TaskContext in case the servant of task is in the same process.
| task | The Object to create a proxy for. |
| 0 | if the ORB is not initialised |
Definition at line 463 of file ControlTaskProxy.cpp.
References ControlTaskProxy::ControlTaskProxy(), ApplicationServer::orb, and IllegalServer::what().
| Corba::ControlTask_ptr server | ( | ) | const |
Get the Corba Object of the ControlTask.
This object universally identifies the remote ControlTaskServer and can be used to tell other (remote) objects where to find it.
Definition at line 824 of file ControlTaskProxy.cpp.
Referenced by ControlTaskProxy::addPeer().
| bool activate | ( | ) | [virtual] |
This method starts the execution of this component in order to process events and commands.
This function calls activateHook() which must return true in order to allow this processing. You can override this method to do something else or in addition to starting the ExecutionEngine.
| false |
| |
| true | if the Active state was entered. |
Reimplemented from TaskCore.
Definition at line 526 of file ControlTaskProxy.cpp.
References TaskContext::clear(), and ControlTaskProxy::setName().
| bool start | ( | ) | [virtual] |
This method starts the execution engine of this component (if not already running) and executes the updateHook() with each period.
This function calls the user function startHook(), which must return true in order to allow this component to run.
| false |
| |
| true | if the Running state was entered. |
Reimplemented from TaskCore.
Definition at line 502 of file ControlTaskProxy.cpp.
References TaskContext::clear(), and ControlTaskProxy::setName().
| bool stop | ( | ) | [virtual] |
This method stops the execution engine of this component.
You can override this method to do something else or in addition to stopping the engine. This function calls cleanupHook() as well.
Reimplemented from TaskCore.
Definition at line 514 of file ControlTaskProxy.cpp.
References TaskContext::clear(), and ControlTaskProxy::setName().
| bool isRunning | ( | ) | const [virtual] |
Inspect if the component is in the Running, RunTimeWarning or RunTimeError state.
As RunTimeWarning and RunTimeError are substates of Running, this method also returns true when the component is in one of these states. See inRunTimeError() and inRunTimeWarning() for testing these error conditions.
Reimplemented from TaskCore.
Definition at line 560 of file ControlTaskProxy.cpp.
| bool configure | ( | ) | [virtual] |
This method instructs the component to (re-)read configuration data and try to enter the Stopped state.
This can only succeed if the component is not running and configureHook() returns true.
Reimplemented from TaskCore.
Definition at line 570 of file ControlTaskProxy.cpp.
References TaskContext::clear(), and ControlTaskProxy::setName().
| bool cleanup | ( | ) | [virtual] |
This method instructs a stopped component to enter the pre-operational state again.
It calls cleanupHook(). The run-time error and warning counters are reset to zero as well.
Reimplemented from TaskCore.
Definition at line 582 of file ControlTaskProxy.cpp.
References TaskContext::clear(), and ControlTaskProxy::setName().
| bool resetError | ( | ) | [virtual] |
If the component entered the FatalError state, call this method to recover.
It will call the user function resetHook(): if it returns false, the PreOperational state is entered, if it returns true, the Stopped state is entered. You can not use this method to recover from the RunTimeWarning or RunTimeError states, use recover() instead.
| true | if the component is in the Stopped or PreOperational state. | |
| false | if the component was not in the FatalError state. |
Reimplemented from TaskCore.
Definition at line 538 of file ControlTaskProxy.cpp.
References TaskContext::clear(), and ControlTaskProxy::setName().
| bool isActive | ( | ) | const [virtual] |
Inspect if the component is processing events, i.e.
in the Active or Running state.
Reimplemented from TaskCore.
Definition at line 550 of file ControlTaskProxy.cpp.
| bool isConfigured | ( | ) | const [virtual] |
Inspect if the component is configured, i.e.
in the Stopped, Active or Running state.
Reimplemented from TaskCore.
Definition at line 594 of file ControlTaskProxy.cpp.
| bool addPeer | ( | TaskContext * | peer, | |
| std::string | alias = "" | |||
| ) | [virtual] |
Add a one-way connection from this task to a peer task.
| peer | The peer to add. | |
| alias | An optional alias (another name) for the peer. defaults to peer->getName() |
Reimplemented from TaskContext.
Definition at line 669 of file ControlTaskProxy.cpp.
References TaskContext::clear(), ControlTaskServer::Create(), ControlTaskServer::server(), ControlTaskProxy::server(), and ControlTaskProxy::setName().
| TaskContext * getPeer | ( | const std::string & | peer_name | ) | const [virtual] |
Get a pointer to a peer of this task.
Reimplemented from TaskContext.
Definition at line 777 of file ControlTaskProxy.cpp.
References ControlTaskProxy::Create(), and TaskContext::getPeer().
| bool ready | ( | ) | [virtual] |
Checks the validity of this TaskContext.
When this method returns false, the TaskContext should not be used and various methods may throw exceptions. Use this in case the TaskContext could be a remote object. Will always return true when this TaskContext is local.
Reimplemented from TaskContext.
Definition at line 807 of file ControlTaskProxy.cpp.
References TaskContext::clear().
| virtual OperationInterface* getParent | ( | ) | [inline, virtual, inherited] |
Returns the parent OperationInterface in which this TaskObject lives.
A TaskObject can have only one parent.
Implements OperationInterface.
Definition at line 140 of file TaskContext.hpp.
| virtual void setEngine | ( | ExecutionEngine * | ) | [inline, virtual, inherited] |
This method is ignored by the TaskContext.
Implements OperationInterface.
Definition at line 152 of file TaskContext.hpp.
| void exportPorts | ( | ) | [inherited] |
Call this function to force a TaskContext to export its Data Flow ports as scripting objects.
Definition at line 197 of file TaskContext.cpp.
References TaskContext::addObject(), OperationInterface::getObject(), DataFlowInterface::getPorts(), and TaskContext::ports().
| void disconnect | ( | ) | [virtual, inherited] |
Disconnect this TaskContext from it's peers.
All its Data Flow Ports are disconnected from the connections but the connections themselves may continue to exist to serve other TaskContexts. This method invokes removePeer() as well on the peers listed in this->getPeerList().
Definition at line 370 of file TaskContext.cpp.
References TaskContext::_task_map, TaskContext::getName(), DataFlowInterface::getPorts(), TaskContext::musers, and TaskContext::ports().
| void reconnect | ( | ) | [virtual, inherited] |
Reconnect the data ports of this task, without removing the peer relationship.
Use this if you changed a port name of an already connected task.
Definition at line 352 of file TaskContext.cpp.
References TaskContext::_task_map, TaskContext::connectPorts(), TaskContext::getName(), DataFlowInterface::getPorts(), and TaskContext::ports().
| bool addObject | ( | OperationInterface * | obj | ) | [virtual, inherited] |
Add a new TaskObject to this TaskContext.
| obj | This object becomes owned by this TaskContext. |
Reimplemented from OperationInterface.
Definition at line 421 of file TaskContext.cpp.
References OperationInterface::addObject(), TaskCore::engine(), and OperationInterface::setEngine().
Referenced by TaskContext::exportPorts(), and MarshallingAccess::MarshallingAccess().
| void clear | ( | ) | [virtual, inherited] |
Clear the complete interface of this Component.
This method removes all objects and all methods, commands, events, properties and ports from the interface of this TaskContext.
Reimplemented from OperationInterface.
Definition at line 428 of file TaskContext.cpp.
References PropertyBag::clear(), TaskContext::ports(), TaskContext::properties(), and OperationInterface::removeObject().
Referenced by ControlTaskProxy::activate(), ControlTaskProxy::addPeer(), ControlTaskProxy::cleanup(), ControlTaskProxy::configure(), ControlTaskProxy::connectPeers(), ControlTaskProxy::connectPorts(), ControlTaskProxy::ControlTaskProxy(), ControlTaskProxy::disconnectPeers(), ControlTaskProxy::ready(), ControlTaskProxy::removePeer(), ControlTaskProxy::resetError(), ControlTaskProxy::start(), and ControlTaskProxy::stop().
| ExecutionAccess* execution | ( | ) | [inline, inherited] |
Get access to high level controls for controlling programs and state machines.
It is the implementation of the 'engine' TaskObject.
Definition at line 280 of file TaskContext.hpp.
| const ExecutionAccess* execution | ( | ) | const [inline, inherited] |
Get access to high level controls for controlling programs and state machines.
It is the implementation of the 'engine' TaskObject.
Definition at line 291 of file TaskContext.hpp.
| OperationInterface * getObject | ( | const std::string & | obj_name | ) | [virtual, inherited] |
Get a pointer to a previously added TaskObject.
| obj_name | The name of the TaskObject |
Definition at line 86 of file OperationInterface.cpp.
References OperationInterface::mobjects.
Referenced by OperationInterface::addObject(), TaskContext::exportPorts(), MarshallingAccess::MarshallingAccess(), and OperationInterface::removeObject().
| std::vector< std::string > getObjectList | ( | ) | const [virtual, inherited] |
Get a list of all the object names of this interface.
Definition at line 99 of file OperationInterface.cpp.
References OperationInterface::getName(), and OperationInterface::mobjects.
| bool removeObject | ( | const std::string & | obj_name | ) | [virtual, inherited] |
Remove and delete a previously added TaskObject.
Deletion will only occur if obj_name's parent is this. You can avoid deletion by first calling
this->getObject( obj_name )->setParent(0);
| obj_name | The name of the TaskObject to remove |
Definition at line 108 of file OperationInterface.cpp.
References OperationInterface::attributes(), AttributeRepository::clear(), EventService::clear(), CommandRepository::clear(), MethodRepository::clear(), OperationInterface::commands(), OperationInterface::events(), OperationInterface::getObject(), OperationInterface::getParent(), OperationInterface::methods(), and OperationInterface::mobjects.
Referenced by TaskContext::clear().
| double getPeriod | ( | ) | const [virtual, inherited] |
Get the configured execution period of this component.
Note that this value only is used when the component isActive() or isRunning().
| 0.0 | if the component is non-periodic (event based). | |
| a | negative number when the component is not executable. | |
| a | positive value when the component is periodic. The period is expressed in seconds. |
Definition at line 208 of file TaskCore.cpp.
References TaskCore::engine().
| bool doUpdate | ( | ) | [virtual, inherited] |
Invoke this method to execute the ExecutionEngine and the update() method.
This method maps to the 'update()' method in the scripting language.
| false | if this->engine()->getActivity()->execute() == false | |
| true | otherwise. |
Definition at line 85 of file TaskCore.cpp.
References TaskCore::engine().
| bool doTrigger | ( | ) | [virtual, inherited] |
Invoke this method to trigger the thread of this TaskContext to execute its ExecutionEngine and the update() method.
This method maps to the 'trigger()' method in the scripting language.
| false | if this->engine()->getActivity()->trigger() == false | |
| true | otherwise. |
Definition at line 92 of file TaskCore.cpp.
References TaskCore::engine().
| void setExecutionEngine | ( | ExecutionEngine * | engine | ) | [inherited] |
Use this method to re-set the execution engine of this task core.
| engine | The new execution engine which will execute this TaskCore or null if a new execution engine must be created (the old is deleted in that case). |
Definition at line 254 of file TaskCore.cpp.
References ExecutionEngine::addChild(), TaskCore::ee, ExecutionEngine::getParent(), and ExecutionEngine::removeChild().
| bool configureHook | ( | ) | [protected, virtual, inherited] |
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.
| true | to indicate that configuration succeeded and the Stopped state may be entered. | |
| false | to indicate that configuration failed and the Preoperational state is entered. |
Definition at line 213 of file TaskCore.cpp.
Referenced by TaskCore::configure().
| void cleanupHook | ( | ) | [protected, virtual, inherited] |
Implement this method such that it contains the code which will be executed when cleanup() is called.
The default implementation is an empty function.
Definition at line 180 of file TaskCore.cpp.
Referenced by TaskCore::cleanup().
| bool activateHook | ( | ) | [protected, virtual, inherited] |
Implement this method such that it contains the code which will be executed when activate() is called.
Return false if the component may not be activated.
Definition at line 239 of file TaskCore.cpp.
Referenced by ExecutionEngine::startContexts().
| bool startHook | ( | ) | [protected, virtual, inherited] |
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.
| true | to indicate that the component may run and the Running state may be entered. | |
| false | to indicate that the component may not run and the Stopped state is entered. |
Definition at line 229 of file TaskCore.cpp.
References TaskCore::startup().
Referenced by ExecutionEngine::startContexts().
| bool startup | ( | ) | [protected, virtual, inherited] |
Function where the user must insert his 'startup' code.
This function is called by the ExecutionEngine before it starts its processors. If it returns false, the startup of the TaskCore is aborted. The default implementation is an empty function which returns true.
Definition at line 220 of file TaskCore.cpp.
Referenced by TaskCore::startHook().
| void updateHook | ( | ) | [protected, virtual, inherited] |
Function where the user must insert his 'application' code.
When the ExecutionEngine's Activity is a PeriodicActivity, this function is called by the ExecutionEngine in each periodic step after all command, event,... are processed. When it is executed by a NonPeriodicActivity, this function is called after an Event or Command 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.
Definition at line 244 of file TaskCore.cpp.
References TaskCore::update().
Referenced by ExecutionEngine::step().
| void errorHook | ( | ) | [protected, virtual, inherited] |
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 recovered(). After recovered(), the updateHook() is called again.
Definition at line 217 of file TaskCore.cpp.
Referenced by ExecutionEngine::step().
| void update | ( | ) | [protected, virtual, inherited] |
Function where the user must insert his 'application' code.
When the ExecutionEngine's Activity is a PeriodicActivity, this function is called by the ExecutionEngine in each periodic step after all command, event,... processors. When it's Task is a NonPeriodicActivity, this function is called after an Event or Command 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.
Definition at line 224 of file TaskCore.cpp.
Referenced by TaskCore::updateHook().
| void stopHook | ( | ) | [protected, virtual, inherited] |
Implement this method such that it contains the code which will be executed when stop() is called.
The default implementation is an empty function.
Definition at line 249 of file TaskCore.cpp.
References TaskCore::shutdown().
Referenced by ExecutionEngine::finalize(), and ExecutionEngine::startContexts().
| void shutdown | ( | ) | [protected, virtual, inherited] |
Function where the user must insert his 'shutdown' code.
This function is called by the ExecutionEngine after it stops its processors. The default implementation is an empty function.
Definition at line 226 of file TaskCore.cpp.
Referenced by TaskCore::stopHook().
| bool resetHook | ( | ) | [protected, virtual, inherited] |
Implement this method to recover from the FatalError state.
Return false if no recovery was possible and the PreOperational state must be entered. Return true to allow transition to the Stopped state.
Definition at line 234 of file TaskCore.cpp.
Referenced by TaskCore::resetError().
| void warning | ( | ) | [protected, virtual, inherited] |
Call this method in a Running state to indicate a run-time warning condition.
If the warning condition is solved, call recovered().
Definition at line 127 of file TaskCore.cpp.
References TaskCore::Running, and TaskCore::RunTimeWarning.
| void error | ( | ) | [protected, virtual, inherited] |
Call this method in a Running state to indicate a run-time error condition.
errorHook() will be called instead of updateHook(). If the warning condition is solved, call recovered().
Definition at line 134 of file TaskCore.cpp.
References TaskCore::Running, and TaskCore::RunTimeError.
| void fatal | ( | ) | [protected, virtual, inherited] |
Call this method from any place to indicate that this component encountered a fatal error.
The ExecutionEngine is stopped, stopHook() is called and the component waits for a resetError().
Definition at line 123 of file TaskCore.cpp.
References TaskCore::FatalError.
| void recovered | ( | ) | [protected, virtual, inherited] |
Call this method in a Running state to indicate that the run-time warning or error conditions are gone and nominal operation is resumed.
You can not use this method to recover from a fatal() error. Use resetError() instead.
Definition at line 141 of file TaskCore.cpp.
References TaskCore::Running.
1.5.6