SCL
1.0
Standard Control Library : Control, dynamics, physics, and simulation
|
#include <SNonControlTaskBase.hpp>
Public Member Functions | |
SNonControlTaskBase () | |
bool | init (const std::string &arg_name, const std::string &arg_type, const std::vector< scl::sString2 > &arg_nonstd_params) |
bool | setParentController (const SControllerMultiTask *arg_parent) |
virtual bool | initTaskParams ()=0 |
virtual const std::string & | getType () const |
virtual const std::string & | getName () const |
virtual bool | hasBeenInit () const |
Public Attributes | |
const SControllerMultiTask * | parent_controller_ |
std::string | type_task_ |
scl::sBool | has_been_activated_ |
std::vector< sString2 > | task_nonstd_params_ |
std::string | name_ |
sBool | has_been_init_ |
Protected Attributes | |
std::string | type_ |
Contains all the data required to compute some (arbitrary) non-control related computation.
For instance a logging task could log a ton of data to a stream. Or an I/O task could send the latest model details to a remote location that can render them.
Any arbitrary task works as long as it doesn't require some sort of interference with the controller..
NOTE : YOU CAN NOT USE THIS TASK DATA STRUCTURE DIRECTLY. You must subclass it, re-implement the function: virtual bool initTaskParams()=0; to parse all the custom parameters (from the xml file) stored in task_nonstd_params_. The function must then return true.
scl::SNonControlTaskBase::SNonControlTaskBase | ( | ) |
Constructor
|
inlinevirtualinherited |
Get the object's type
|
inlinevirtualinherited |
Get the object's type
|
inlinevirtualinherited |
Get the object's type
bool scl::SNonControlTaskBase::init | ( | const std::string & | arg_name, |
const std::string & | arg_type, | ||
const std::vector< scl::sString2 > & | arg_nonstd_params | ||
) |
Initialization function.
NOTE : This function also activates the task.
arg_nonstd_params | These are ignored during SNonControlTaskBase initialization. However, subclasses may choose to use them and/or require various values |
|
pure virtual |
Processes the task's non standard parameters, which the init() function stores in the task_nonstd_params_.
NOTE: This function is called by init() and must be implemented by all subclasses. Else it will be impossible to initialize the task. Ie. init() will always return false.
Implemented in scl::SNonControlTaskParsedData.
bool scl::SNonControlTaskBase::setParentController | ( | const SControllerMultiTask * | arg_parent | ) |
Sets the parent controller
scl::sBool scl::SNonControlTaskBase::has_been_activated_ |
Whether the task is active or inactive Default = false. True after init()
|
inherited |
Whether the object is ready for use
|
inherited |
The object's name
const SControllerMultiTask* scl::SNonControlTaskBase::parent_controller_ |
The parent controller
std::vector<sString2> scl::SNonControlTaskBase::task_nonstd_params_ |
A set of additional options that may be used by users to initialize this specific task. These typically go above and beyond the standard options.
Eg.The parent link and the pos in parent, which are required by op point tasks but not by gc tasks. These will be stored like: task_options_[0].data_[0] = "parent_link"; task_options_[0].data_[1] = "base"; task_options_[1].data_[0] = "pos_in_parent"; task_options_[1].data_[1] = "0.0 0.0 0.0";
|
protectedinherited |
The object's type. Should only be set by the constructor
std::string scl::SNonControlTaskBase::type_task_ |
The type of the task