AGX Dynamics 2.42.3.0
Loading...
Searching...
No Matches
agx::RealTimeClock Class Reference

#include <RealTimeClock.h>

+ Inheritance diagram for agx::RealTimeClock:

Public Member Functions

void tick ()
 
- Public Member Functions inherited from agx::Clock
 Clock (const agx::Name &name="clock", agx::Real frequency=60)
 
void addEvent (agx::Clock::Event *event)
 Add an event to the clock to be triggered as specified by the event.
 
void addFrameJob (agx::Job *job)
 Add a job to be executed on each tick.
 
void addFrameTask (agx::Task *task)
 Add a task to be executed on each tick.
 
void addSlave (agx::Clock *slave)
 Add a slave clock, to be driven by this clock.
 
void bind (const agx::Path &path)
 Bind the clock to a reference clock using a bindpath.
 
virtual void configure (TiXmlElement *eClock) override
 
virtual void configure (TiXmlElement *eEvent) override
 
 Event (const agx::Callback &callback, agx::Real startDelay, agx::Real interval=-1.0)
 
 Event (const agx::Name &name="Event")
 Constructor.
 
const agx::Path & getBindPath () const
 
agx::Clock * getClock ()
 
agx::UInt getFrame () const
 
agx::Real getFrequency () const
 
size_t getIndex () const
 
agx::Real getInterval () const
 Get the trigger interval.
 
bool getIsThreadTimelineResponsible () const
 
agx::Clock * getReference ()
 
const agx::ClockPtrVector & getSlaves () const
 
agx::Real getStartDelay () const
 
agx::Real getTime () const
 
agx::Real getTimeModulation () const
 
agx::Real getTimeStep () const
 
agx::Bool isEnabled () const
 
bool isRepeating () const
 
virtual void rebind () override
 
void removeEvent (agx::Clock::Event *event)
 Remove an event from the clock.
 
void removeFrameJob (agx::Job *job)
 Remove a frame job.
 
void removeFrameTask (agx::Task *task)
 Remove a frame task.
 
void removeSlave (agx::Clock *slave)
 Remove a slave clock.
 
void reset ()
 Reset to frame zero (and time=0), remove all events.
 
void reset ()
 Reset event, with start delay.
 
virtual void save (TiXmlElement *eParent) const override
 
void setEnable (agx::Bool flag)
 Set to false to disable the clock, tick will be void operation.
 
void setEnable (bool flag)
 Pause/unpause.
 
void setFrame (UInt frame)
 Explicitly set the current frame index.
 
void setFrequency (agx::Real frequency)
 Set the clock frequency.
 
void setInterval (agx::Real interval)
 Set the trigger interval.
 
void setIsThreadTimelineResponsible (bool isResponsible)
 Control whether this Clock is the main clock for thread timeline generation.
 
void setRepeating (bool flag)
 Set if event trigger multiple times.
 
void setStartDelay (agx::Real time)
 Set the start delay when added to a clock or reset.
 
void setTime (agx::Real64 time)
 Set the time explicitly, without ticking.
 
void setTimeModulation (agx::Real modulation)
 Set the time modulation of the clock, default is 1.0.
 
bool setTimeStep (agx::Real dt)
 Set the time step of the clock, 1/frequency.
 
void start ()
 Same as setEnable(true)
 
void stepForward (agx::Real delta)
 Advance the clock a specified interval.
 
void stepTo (agx::Real time)
 Advance the clock to a specified time.
 
void stop ()
 Same as setEnable(false)
 
void tick (bool blocking=true)
 Advance the clock to the next time step.
 
- Public Member Functions inherited from agx::Component
 Component (const agx::Name &name=agx::Name(), agx::Model *model=agx::Component::ClassModel(), agx::Device *device=nullptr)
 
virtual void addObject (agx::Object *object, bool assignContext=true)
 Add an object to the component.
 
virtual String autoComplete (const String &partialName, StringVector &matchingNames) const
 
virtual void buildNavigationTree (agxJson::Value &eNode) const override
 
void configure (Model *model)
 
virtual void configure (TiXmlElement *eComponent) override
 
agx::Device * getDevice ()
 
template<typename T >
T * getDevice ()
 
const agx::Device * getDevice () const
 
template<typename T >
const T * getDevice () const
 
size_t getNumObjects (const agx::Name &name) const
 
agx::Object * getObject (const agx::Name &name, agx::Model *model, size_t index=0)
 
const agx::Object * getObject (const agx::Name &name, agx::Model *model, size_t index=0) const
 
agx::Object * getObject (const agx::Name &name, size_t index=0)
 
template<typename T >
T * getObject (const agx::Name &name, size_t index=0)
 
const agx::Object * getObject (const agx::Name &name, size_t index=0) const
 
template<typename T >
const T * getObject (const agx::Name &name, size_t index=0) const
 
const agx::ObjectRefVector & getObjects () const
 
template<typename T >
void getObjects (agx::ObjectPtrVector &result, bool recursive=false) const
 Returns All child objects of a specified type in the result container.
 
void getObjects (agx::ObjectPtrVector &result, const agx::Model *model, bool recursive=false) const
 
virtual Object * getResourceImpl (const Path &path, agx::Model *model) override
 
virtual void printSubtree () const override
 
void printSubtree (std::ostream &stream, int depth=0) const
 
virtual void rebind () override
 
void removeAllObjects ()
 Remove all components.
 
virtual void removeObject (agx::Object *object)
 Remove an object from the component.
 
void removeObject (const agx::Name &name, size_t index=0)
 Remove an object with a specified name (and optional index) from the component.
 
virtual void snapshot (TiXmlNode *eParent, const String &directory) const override
 
void traverse (ComponentVisitor *)
 
void traverse (const TraverseCallback &callback)
 
- Public Member Functions inherited from agx::Object
 Object (const Name &name=Name(), Model *model=Object::ClassModel())
 
void addListener (EventListener *listener)
 
virtual void buildNavigationTree (agxJson::Value &eNode) const
 
virtual void configure (TiXmlElement *)
 
agx::String fullName () const
 
agx::String fullPath () const
 
agx::String fullPath (const agx::Object *root) const
 
template<typename T >
T * getAutoScopedResource (const agx::Path &path)
 
template<typename T >
const T * getAutoScopedResource (const agx::Path &path) const
 
agx::Object * getAutoScopedResource (const agx::Path &path, agx::Model *model=nullptr)
 
const agx::Object * getAutoScopedResource (const agx::Path &path, agx::Model *model=nullptr) const
 
agx::Object * getContext ()
 
template<typename T >
T * getContext ()
 
const agx::Object * getContext () const
 
template<typename T >
const T * getContext () const
 
agx::UInt32 getId () const
 
const agx::Name & getImplementationName () const
 
agx::Model * getModel ()
 
const agx::Model * getModel () const
 
const agx::Name & getName () const
 
agx::Object * getNextSibling ()
 
const agx::Object * getNextSibling () const
 
agx::Path getPath () const
 
agx::Path getPath (const agx::Object *root) const
 
template<typename T >
T * getResource (const agx::Path &path)
 
template<typename T >
const T * getResource (const agx::Path &path) const
 
agx::Object * getResource (const agx::Path &path, agx::Model *model=nullptr)
 
const agx::Object * getResource (const agx::Path &path, agx::Model *model=nullptr) const
 
virtual agx::Object * getResourceImpl (const agx::Path &path, agx::Model *model)
 
agx::Object * getRootContext ()
 
const agx::Object * getRootContext () const
 
bool hasListener (EventListener *listener)
 
bool hasParent (const agx::Object *node) const
 
bool isUnique () const
 
virtual void printSubtree () const
 
virtual void rebind ()
 
void removeListener (EventListener *listener)
 
virtual void save (TiXmlElement *) const
 
virtual void setContext (agx::Object *context)
 
void setId (UInt32 id)
 
void setModel (agx::Model *model)
 Set the object model (handled automatically).
 
void setName (const agx::Name &name)
 Set the name of the object.
 
virtual void snapshot (TiXmlNode *, const String &) 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.
 
- Public Member Functions inherited from agx::Event
 Event (const agx::Name &name=agx::Name())
 
void trigger ()
 Trigger the event.
 
- Public Member Functions inherited from agx::EventT< Callback >
 EventT (const agx::Name &name=agx::Name())
 
void addCallback (const Callback *callback)
 Add a callback to the event.
 
void addCallbackFirst (const Callback *callback)
 Add a callback to the front of the callback list.
 
bool containsCallback (const Callback *callback) const
 
const CallbackPtrVector & getCallbacks () const
 
const agx::Name & getName () const
 
void removeAllCallbacks ()
 Remove all callbacks.
 
bool removeCallback (const Callback *callback)
 

Static Public Member Functions

static RealTimeClock * instance ()
 
- Static Public Member Functions inherited from agx::Clock
static agx::Model * ClassModel ()
 
static agx::Model * ClassModel ()
 
static Clock * load (TiXmlElement *eClock, Device *device)
 
static Clock::Event * load (TiXmlElement *eEvent, Device *device)
 
- Static Public Member Functions inherited from agx::Component
static Component * _load (TiXmlElement *eComponent, Device *device)
 
static agx::Model * ClassModel ()
 
static Component * load (const Path &path, const Name &implementation, Device *device, const Path &_namespace=Path())
 
static Component * load (const String &path, const Path &_namespace=Path())
 
static Component * load (const String &path, Device *device, const Path &_namespace=Path())
 
static Component * load (TiXmlElement *eComponent, Device *device)
 
- Static Public Member Functions inherited from agx::Object
static agx::Model * ClassModel ()
 
static agx::String generateName (const agx::String &bindPath)
 
static const HashSet< Object * > & getActiveObjects ()
 
static bool getEnableRebind ()
 Should rebinding be allowed? Right now a global setting.
 
static Object * load (const String &path, Device *device, const String &type, const String &attribute, const String &value)
 
template<typename T >
static T * load (const String &path, Device *device, const String &type, const String &attribute, const String &value)
 
static Object * load (const String &path, Device *device, const String &type="", size_t instance=0)
 
template<typename T >
static T * load (const String &path, Device *device, const String &type="", size_t instance=0)
 
static void load (const String &path, Device *device, ObjectPtrVector &loadedObjects)
 
static Object * load (TiXmlElement *eObject, Device *device)
 
template<typename T >
static T * load (TiXmlElement *eObject, Device *device)
 
static TiXmlDocument openDocument (const String &path)
 
static void setEnableRebind (bool flag)
 Sets if rebinding of objects should be allowed (Right now a global setting).
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 

Protected Member Functions

 RealTimeClock (const Name &name, Real frequency=720)
 
virtual ~RealTimeClock ()
 
- Protected Member Functions inherited from agx::Clock
virtual ~Clock ()
 
virtual ~Event ()
 
- Protected Member Functions inherited from agx::Component
virtual ~Component ()
 
String expandAutoCompletionMatch (const String &query, const StringVector &matchingNames) const
 
void setDevice (Device *device)
 
- Protected Member Functions inherited from agx::Object
virtual ~Object ()
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

Additional Inherited Members

- Public Types inherited from agx::Clock
typedef agx::observer_ptr< const Event > EventConstObserver
 
typedef agx::ref_ptr< const Event > EventConstRef
 
typedef agx::observer_ptr< Event > EventObserver
 
typedef agx::Vector< EventObserver > EventObserverVector
 
typedef agx::VectorPOD< Event * > EventPtrVector
 
typedef agx::ref_ptr< Event > EventRef
 
typedef agx::Vector< EventRef > EventRefVector
 
typedef agx::observer_ptr< const FrameWrapper > FrameWrapperConstObserver
 
typedef agx::ref_ptr< const FrameWrapper > FrameWrapperConstRef
 
typedef agx::observer_ptr< FrameWrapper > FrameWrapperObserver
 
typedef agx::Vector< FrameWrapperObserver > FrameWrapperObserverVector
 
typedef agx::VectorPOD< FrameWrapper * > FrameWrapperPtrVector
 
typedef agx::ref_ptr< FrameWrapper > FrameWrapperRef
 
typedef agx::Vector< FrameWrapperRef > FrameWrapperRefVector
 
typedef Event1< Clock * > TickEvent
 
- Public Types inherited from agx::Component
typedef Event2< Component *, Object * > ObjectEvent
 Event when adding removing child objects.
 
typedef Callback1< Object * > TraverseCallback
 
- Public Types inherited from agx::Object
typedef agx::observer_ptr< const Event > EventConstObserver
 
typedef agx::ref_ptr< const Event > EventConstRef
 
typedef agx::observer_ptr< Event > EventObserver
 
typedef agx::Vector< EventObserver > EventObserverVector
 
typedef agx::VectorPOD< Event * > EventPtrVector
 
typedef agx::ref_ptr< Event > EventRef
 
typedef agx::Vector< EventRef > EventRefVector
 
- Public Types inherited from agx::EventT< Callback >
typedef VectorPOD< const CallbackType * > CallbackPtrVector
 
typedef Callback CallbackType
 
- Public Attributes inherited from agx::Clock
TickEvent postTick
 
TickEvent preTick
 
- Public Attributes inherited from agx::Component
ObjectEvent addObjectEvent
 
ObjectEvent removeObjectEvent
 
- 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.
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 
- Protected Attributes inherited from agx::EventT< Callback >
Thread * m_activeThread
 
CallbackPtrVector m_callbacks
 
agx::UInt32 m_iterationIndex
 
Name m_name
 

Detailed Description

Definition at line 27 of file RealTimeClock.h.

Constructor & Destructor Documentation

◆ RealTimeClock()

agx::RealTimeClock::RealTimeClock ( const Name &  name,
Real  frequency = 720 
)
protected

◆ ~RealTimeClock()

virtual agx::RealTimeClock::~RealTimeClock ( )
protectedvirtual

Member Function Documentation

◆ instance()

static RealTimeClock * agx::RealTimeClock::instance ( )
static

◆ tick()

void agx::RealTimeClock::tick ( )

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