MIRA
Public Member Functions | Public Attributes | List of all members
Task Class Reference

A navigation task that consists of one or multiple sub tasks. More...

#include <navigation/Task.h>

Public Member Functions

template<typename Reflector >
void reflect (Reflector &r)
 The reflect method. More...
 
void addSubTask (SubTaskPtr task)
 Add a subtask to this task. More...
 
template<class T >
boost::shared_ptr< T > getSubTask (bool allowDerived=true)
 Get a subtask of type T. More...
 
template<class T >
boost::shared_ptr< const T > getSubTask (bool allowDerived=true) const
 Get a subtask of type T. More...
 

Public Attributes

std::list< SubTaskPtrsubTasks
 list of subtasks More...
 

Detailed Description

A navigation task that consists of one or multiple sub tasks.

Member Function Documentation

◆ reflect()

void reflect ( Reflector &  r)
inline

The reflect method.

◆ addSubTask()

void addSubTask ( SubTaskPtr  task)
inline

Add a subtask to this task.

In principle multiple subtasks of the same type are allowed. Normally getSubTask is used to retrieve a subtask of a certain type. getSubTask returns the first item in the list that matches the requested type. In this case all other subtasks of the same type will be ignored.

Parameters
[in]taskThe new subtask.

◆ getSubTask() [1/2]

boost::shared_ptr<T> getSubTask ( bool  allowDerived = true)
inline

Get a subtask of type T.

Parameters
allowDerivedSpecifies whether the method should also return tasks that are derived from T (see below).
Returns
pointer to subtask or null pointer if no subtask of type T exists
Note
To understand the allowDerived parameter, imagine the following example: Let Foo and Bar be two task classes, where Bar is derived from Foo. getSubTask<Foo>(true) now also returns sub tasks of the type Bar, while getSubTask<Foo>(false) won't. getSubTask<Foo>(false) will only return sub tasks of the type Foo and not of derived classes.

◆ getSubTask() [2/2]

boost::shared_ptr<const T> getSubTask ( bool  allowDerived = true) const
inline

Get a subtask of type T.

Parameters
allowDerivedSpecifies whether the method should also return tasks that are derived from T (see below).
Returns
pointer to subtask or null pointer if no subtask of type T exists
Note
To understand the allowDerived parameter, imagine the following example: Let Foo and Bar be two task classes, where Bar is derived from Foo. getSubTask<Foo>(true) now also returns sub tasks of the type Bar, while getSubTask<Foo>(false) won't. getSubTask<Foo>(false) will only return sub tasks of the type Foo and not of derived classes.

Member Data Documentation

◆ subTasks

std::list<SubTaskPtr> subTasks

list of subtasks


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