AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agx::SolveAlgorithm::Task Class Reference

Algorithm task either empty, single or group type. More...

#include <SolveAlgorithms.h>

+ Inheritance diagram for agx::SolveAlgorithm::Task:

Classes

struct  ConditionData
 The type of tasks may depend on the data in this structure. More...
 

Public Types

enum  Type {
  EMPTY , EXIT , SINGLE , GROUP ,
  CUSTOM
}
 Task type either EMPTY branch (no callback), EXIT branch (no callback, traversal of this branch will end), SINGLE (getSolveKernel given agx::Solver callback) or GROUP (getSolveKernel given SolveGroupPtr callback). More...
 

Public Member Functions

 Task ()
 Default constructor, type set to EMPTY.
 
void addChild (agx::SolveAlgorithm::Task *child)
 Add child task.
 
virtual void customSetup (Solver *solver, JobGroup *entry, JobGroup *exit)
 
agx::SolveAlgorithm::Task * getChild (agx::UInt i) const
 
agx::UInt getNumChildren () const
 
agx::SolveAlgorithm::Task * getParent () const
 
virtual agx::SolveKernel * getSolveKernel (agx::Physics::SolveGroupPtr group) const
 Callback for solve algorithms task type GROUP.
 
virtual agx::SolveKernel * getSolveKernel (agx::Solver *solver) const
 Callback for solve algorithms task type SINGLE.
 
virtual agx::SolveAlgorithm::Task::Type getType (const agx::SolveAlgorithm::Task::ConditionData &conditionData) const
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 

Protected Types

typedef agx::Vector< agx::ref_ptr< SolveAlgorithm::Task > > SolveAlgorithmTaskContainer
 

Protected Member Functions

 Task (agx::SolveAlgorithm::Task::Type type)
 Construct given type.
 
virtual ~Task ()
 Reference counted object - protected virtual destructor.
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

Protected Attributes

agx::SolveAlgorithm::Task::SolveAlgorithmTaskContainer m_children
 
agx::SolveAlgorithm::Task * m_parent
 
agx::SolveAlgorithm::Task::Type m_type
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Additional Inherited Members

- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 

Detailed Description

Algorithm task either empty, single or group type.

The type of this task determines which callback (getSolveKernel) is called. EMPTY: Includes no jobs but has children. No callback. EXIT: Includes no jobs and any children and/or dependency will be ignored. This is an exit node. No callback. SINGLE: Includes one task (given agx::Solver) and receives getSolveKernel( agx::Solver* ) callback. GROUP: Includes several tasks (given SolveGroupPtr) and receives getSolveKernel( agx::Physics::SolveGroupPtr ) callback.

Definition at line 110 of file SolveAlgorithms.h.

Member Typedef Documentation

◆ SolveAlgorithmTaskContainer

Member Enumeration Documentation

◆ Type

Task type either EMPTY branch (no callback), EXIT branch (no callback, traversal of this branch will end), SINGLE (getSolveKernel given agx::Solver callback) or GROUP (getSolveKernel given SolveGroupPtr callback).

Enumerator
EMPTY 
EXIT 
SINGLE 
GROUP 
CUSTOM 

Definition at line 117 of file SolveAlgorithms.h.

Constructor & Destructor Documentation

◆ Task() [1/2]

agx::SolveAlgorithm::Task::Task ( )

Default constructor, type set to EMPTY.

◆ Task() [2/2]

agx::SolveAlgorithm::Task::Task ( agx::SolveAlgorithm::Task::Type  type)
protected

Construct given type.

Parameters
type- type of this task

◆ ~Task()

virtual agx::SolveAlgorithm::Task::~Task ( )
protectedvirtual

Reference counted object - protected virtual destructor.

Member Function Documentation

◆ addChild()

void agx::SolveAlgorithm::Task::addChild ( agx::SolveAlgorithm::Task *  child)

Add child task.

Parameters
child- child task to add

◆ customSetup()

virtual void agx::SolveAlgorithm::Task::customSetup ( Solver *  solver,
JobGroup *  entry,
JobGroup *  exit 
)
virtual

◆ getChild()

agx::SolveAlgorithm::Task * agx::SolveAlgorithm::Task::getChild ( agx::UInt  i) const
Parameters
i- index of child
Returns
child with index i

◆ getNumChildren()

agx::UInt agx::SolveAlgorithm::Task::getNumChildren ( ) const
Returns
the number of children this parent class has

◆ getParent()

agx::SolveAlgorithm::Task * agx::SolveAlgorithm::Task::getParent ( ) const
Returns
parent task this this task

◆ getSolveKernel() [1/2]

virtual agx::SolveKernel * agx::SolveAlgorithm::Task::getSolveKernel ( agx::Physics::SolveGroupPtr  group) const
virtual

Callback for solve algorithms task type GROUP.

One call for each solve group.

Parameters
group- current solve group
Returns
the solve kernel for this group

◆ getSolveKernel() [2/2]

virtual agx::SolveKernel * agx::SolveAlgorithm::Task::getSolveKernel ( agx::Solver *  solver) const
virtual

Callback for solve algorithms task type SINGLE.

Parameters
solver- solver with tasks
Returns
the solve kernel for this task

◆ getType()

virtual agx::SolveAlgorithm::Task::Type agx::SolveAlgorithm::Task::getType ( const agx::SolveAlgorithm::Task::ConditionData &  conditionData) const
virtual
Returns
the type of this solve algorithm task

Member Data Documentation

◆ m_children

agx::SolveAlgorithm::Task::SolveAlgorithmTaskContainer agx::SolveAlgorithm::Task::m_children
protected

Definition at line 196 of file SolveAlgorithms.h.

◆ m_parent

agx::SolveAlgorithm::Task* agx::SolveAlgorithm::Task::m_parent
protected

Definition at line 197 of file SolveAlgorithms.h.

◆ m_type

agx::SolveAlgorithm::Task::Type agx::SolveAlgorithm::Task::m_type
protected

Definition at line 198 of file SolveAlgorithms.h.


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