RobWorkProject  21.8.23-
Public Types | Public Member Functions | Protected Member Functions | List of all members
Task< T > Class Template Reference

Template based implementation of Task. More...

#include <Task.hpp>

Public Types

typedef rw::core::Ptr< Task< T > > Ptr
 smart pointer type to this class
 
typedef int INT
 

Public Member Functions

 Task (const std::string &id="")
 Constructs Task. More...
 
virtual ~Task ()
 Destructor.
 
Target< T >::Ptr addTargetByValue (const T &value)
 Adds target to task based on value. More...
 
Target< T >::Ptr addTargetByValueToFront (const T &value)
 
void addToPath (typename Task< T >::Ptr task, std::vector< T > &result)
 Adds values of targets in the task to result. More...
 
void addToTargetPath (typename Task< T >::Ptr task, std::vector< typename Target< T >::Ptr > &result)
 
std::vector< T > getPath ()
 Returns a vector with template type T, describing the target values visited when executing the task. More...
 
std::vector< typename Target< T >::PtrgetTargetPath ()
 
virtual Task< T >::Ptr clone ()
 

Protected Member Functions

virtual TaskBase::Ptr doClone ()
 

Detailed Description

template<class T>
class rwlibs::task::Task< T >

Template based implementation of Task.

Constructor & Destructor Documentation

◆ Task()

Task ( const std::string &  id = "")
inline

Constructs Task.

When constructing a task the type T is automatically added to the TypeRepository and the their associated value is set as the type.

Member Function Documentation

◆ addTargetByValue()

Target< T >::Ptr addTargetByValue ( const T &  value)
inline

Adds target to task based on value.

Parameters
value[in] Value of the target.
Returns
Pointer to the target object constructed and added.

◆ addToPath()

void addToPath ( typename Task< T >::Ptr  task,
std::vector< T > &  result 
)
inline

Adds values of targets in the task to result.

Utility function which can be used to construct a list of via points from a task.

See also Task::getPath() below.

Parameters
task[in] Task to run through
result[in] Vector into which targets pointer should be placed

◆ getPath()

std::vector< T > getPath ( )
inline

Returns a vector with template type T, describing the target values visited when executing the task.

This function can be used to make a simple path from a task.

Returns
Vector with target values visited.

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