AGXDynamics  2.31.1.0
agxSDK::SimulationProxy Class Referenceabstract

Interface class used by internal objects running in parallel. More...

#include <SimulationProxy.h>

+ Inheritance diagram for agxSDK::SimulationProxy:

Public Member Functions

virtual bool add (agxCollide::Geometry *geometry)=0
 
virtual bool add (agx::RigidBody *body, bool addGeometries=true)=0
 
virtual bool add (agx::Constraint *c)=0
 
virtual bool add (agx::StrongInteraction *si)=0
 
virtual bool add (agxSDK::Assembly *assembly)=0
 
virtual bool add (agxSDK::EventListener *listener)=0
 
virtual void addGeometryContacts (const agxCollide::LocalGeometryContactVector &contacts)=0
 
virtual void addGroup (agxCollide::Geometry *geometry, agx::UInt32 id)=0
 
virtual void addGroup (agxCollide::Geometry *geometry, const agx::Name &name)=0
 
template<typename T >
T * as ()
 Subclass casting. More...
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match. More...
 
template<typename T >
const T * asSafe () const
 
virtual void commit (agxSDK::Simulation *simulation)=0
 
virtual bool empty () const =0
 
virtual const agx::GravityField * getGravityField () const =0
 
virtual const agxSDK::MaterialManager * getMaterialManager () const =0
 
int getReferenceCount () const
 
virtual bool getRunningParallel () const =0
 
virtual const agxSDK::Simulation * getSimulation () const =0
 
virtual agxSDK::Simulation * getSimulationUnsafe () const =0
 
virtual agx::Real getTimeStep () const =0
 
template<typename T >
bool is () const
 Subclass test. More...
 
virtual void postParallelRun ()=0
 
virtual void preParallelRun ()=0
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
virtual bool remove (agxCollide::Geometry *geometry)=0
 
virtual bool remove (agx::RigidBody *body, bool removeGeometries=true)=0
 
virtual bool remove (agx::Constraint *c)=0
 
virtual bool remove (agx::StrongInteraction *si)=0
 
virtual bool remove (agxSDK::Assembly *assembly)=0
 
virtual bool remove (agxSDK::EventListener *listener)=0
 
virtual void removeGroup (agxCollide::Geometry *geometry, agx::UInt32 id)=0
 
virtual void removeGroup (agxCollide::Geometry *geometry, const agx::Name &name)=0
 
virtual void setEnable (agxCollide::Geometry *geometry, bool enable)=0
 
virtual void setEnable (agx::RigidBody *body, bool enable)=0
 
virtual void setSimulation (agxSDK::Simulation *simulation)=0
 
virtual void transferToDefaultStorage (agx::ContactMaterial *material)=0
 
virtual void transferToSimulationStorage (agx::ContactMaterial *material)=0
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 

Static Public Member Functions

template<typename T >
static bool ValidateCast (const Referenced *object)
 

Protected Member Functions

void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

Static Protected Member Functions

static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More...
 

Protected Attributes

Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Interface class used by internal objects running in parallel.

For documentation, check agxWire::SimulationProxy.

Definition at line 49 of file SimulationProxy.h.

Member Function Documentation

◆ add() [1/6]

virtual bool agxSDK::SimulationProxy::add ( agxCollide::Geometry *  geometry)
pure virtual

◆ add() [2/6]

virtual bool agxSDK::SimulationProxy::add ( agx::RigidBody *  body,
bool  addGeometries = true 
)
pure virtual

◆ add() [3/6]

virtual bool agxSDK::SimulationProxy::add ( agx::Constraint *  c)
pure virtual

◆ add() [4/6]

virtual bool agxSDK::SimulationProxy::add ( agx::StrongInteraction *  si)
pure virtual

◆ add() [5/6]

virtual bool agxSDK::SimulationProxy::add ( agxSDK::Assembly *  assembly)
pure virtual

◆ add() [6/6]

virtual bool agxSDK::SimulationProxy::add ( agxSDK::EventListener *  listener)
pure virtual

◆ addGeometryContacts()

virtual void agxSDK::SimulationProxy::addGeometryContacts ( const agxCollide::LocalGeometryContactVector &  contacts)
pure virtual

◆ addGroup() [1/2]

virtual void agxSDK::SimulationProxy::addGroup ( agxCollide::Geometry *  geometry,
agx::UInt32  id 
)
pure virtual

◆ addGroup() [2/2]

virtual void agxSDK::SimulationProxy::addGroup ( agxCollide::Geometry *  geometry,
const agx::Name &  name 
)
pure virtual

◆ allocateObserverVector()

void agx::Referenced::allocateObserverVector ( ) const
protectedinherited

◆ as() [1/2]

template<typename T >
T* agx::Referenced::as ( )
inherited

Subclass casting.

Template type must match actual type, dynamic_cast assertion will fail otherwise.

Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), agx::InternalData::getOrCreate(), and agx::InternalData::hasData().

◆ as() [2/2]

template<typename T >
const T* agx::Referenced::as ( ) const
inherited

◆ asSafe() [1/2]

template<typename T >
T* agx::Referenced::asSafe ( )
inherited

Safe subclass casting, return nullptr if template type does not match.

Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().

◆ asSafe() [2/2]

template<typename T >
const T* agx::Referenced::asSafe ( ) const
inherited

◆ commit()

virtual void agxSDK::SimulationProxy::commit ( agxSDK::Simulation *  simulation)
pure virtual

◆ deleteUsingDeleteHandler()

void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited

◆ empty()

virtual bool agxSDK::SimulationProxy::empty ( ) const
pure virtual

◆ getDeleteHandler()

static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.

◆ getGravityField()

virtual const agx::GravityField* agxSDK::SimulationProxy::getGravityField ( ) const
pure virtual

◆ getMaterialManager()

virtual const agxSDK::MaterialManager* agxSDK::SimulationProxy::getMaterialManager ( ) const
pure virtual

◆ getReferenceCount()

int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.

◆ getRunningParallel()

virtual bool agxSDK::SimulationProxy::getRunningParallel ( ) const
pure virtual

◆ getSimulation()

virtual const agxSDK::Simulation* agxSDK::SimulationProxy::getSimulation ( ) const
pure virtual

◆ getSimulationUnsafe()

virtual agxSDK::Simulation* agxSDK::SimulationProxy::getSimulationUnsafe ( ) const
pure virtual

◆ getTimeStep()

virtual agx::Real agxSDK::SimulationProxy::getTimeStep ( ) const
pure virtual

◆ is()

template<typename T >
bool agx::Referenced::is ( ) const
inherited

◆ postParallelRun()

virtual void agxSDK::SimulationProxy::postParallelRun ( )
pure virtual

◆ preParallelRun()

virtual void agxSDK::SimulationProxy::preParallelRun ( )
pure virtual

◆ reference()

void agx::Referenced::reference ( void *  ptr = nullptr) const
inherited

Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.

This method should be used with care, always balanced with the same number of calls to unreference.

◆ remove() [1/6]

virtual bool agxSDK::SimulationProxy::remove ( agxCollide::Geometry *  geometry)
pure virtual

◆ remove() [2/6]

virtual bool agxSDK::SimulationProxy::remove ( agx::RigidBody *  body,
bool  removeGeometries = true 
)
pure virtual

◆ remove() [3/6]

virtual bool agxSDK::SimulationProxy::remove ( agx::Constraint *  c)
pure virtual

◆ remove() [4/6]

virtual bool agxSDK::SimulationProxy::remove ( agx::StrongInteraction *  si)
pure virtual

◆ remove() [5/6]

virtual bool agxSDK::SimulationProxy::remove ( agxSDK::Assembly *  assembly)
pure virtual

◆ remove() [6/6]

virtual bool agxSDK::SimulationProxy::remove ( agxSDK::EventListener *  listener)
pure virtual

◆ removeGroup() [1/2]

virtual void agxSDK::SimulationProxy::removeGroup ( agxCollide::Geometry *  geometry,
agx::UInt32  id 
)
pure virtual

◆ removeGroup() [2/2]

virtual void agxSDK::SimulationProxy::removeGroup ( agxCollide::Geometry *  geometry,
const agx::Name &  name 
)
pure virtual

◆ setDeleteHandler()

static void agx::Referenced::setDeleteHandler ( DeleteHandler *  handler)
staticprotectedinherited

Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.

◆ setEnable() [1/2]

virtual void agxSDK::SimulationProxy::setEnable ( agxCollide::Geometry *  geometry,
bool  enable 
)
pure virtual

◆ setEnable() [2/2]

virtual void agxSDK::SimulationProxy::setEnable ( agx::RigidBody *  body,
bool  enable 
)
pure virtual

◆ setSimulation()

virtual void agxSDK::SimulationProxy::setSimulation ( agxSDK::Simulation *  simulation)
pure virtual

◆ transferToDefaultStorage()

virtual void agxSDK::SimulationProxy::transferToDefaultStorage ( agx::ContactMaterial *  material)
pure virtual

◆ transferToSimulationStorage()

virtual void agxSDK::SimulationProxy::transferToSimulationStorage ( agx::ContactMaterial *  material)
pure virtual

◆ unreference()

void agx::Referenced::unreference ( void *  ptr = nullptr) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.

This method should be used with care, always balanced with the same number of calls to reference.

Referenced by agxData::EntityRef< ContactMaterialPtr >::~EntityRef().

◆ unreference_nodelete()

void agx::Referenced::unreference_nodelete ( ) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.

◆ ValidateCast()

template<typename T >
static bool agx::Referenced::ValidateCast ( const Referenced *  object)
staticinherited

Member Data Documentation

◆ m_mutex

Mutex agx::Referenced::m_mutex
mutableprotectedinherited

Definition at line 240 of file Referenced.h.

◆ m_observers

ObserverContainer agx::Referenced::m_observers
mutableprotectedinherited

Definition at line 239 of file Referenced.h.

◆ m_refCount

AtomicValue agx::Referenced::m_refCount
mutableprotectedinherited

Definition at line 241 of file Referenced.h.


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