|
AGXDynamics
2.31.1.0
|
#include <RealTimeClock.h>
Inheritance diagram for agx::RealTimeClock:Public Types | |
| typedef VectorPOD< const CallbackType * > | CallbackPtrVector |
| typedef Callback | CallbackType |
| typedef agx::observer_ptr < const Event > | EventConstObserver |
| typedef agx::ref_ptr< const Event > | EventConstRef |
| typedef agx::observer_ptr< Event > | EventObserver |
| typedef agx::ref_ptr< Event > | EventRef |
| typedef agx::observer_ptr < const FrameWrapper > | FrameWrapperConstObserver |
| typedef agx::ref_ptr< const FrameWrapper > | FrameWrapperConstRef |
| typedef agx::observer_ptr < FrameWrapper > | FrameWrapperObserver |
| typedef agx::ref_ptr < FrameWrapper > | FrameWrapperRef |
| typedef Event2< Component *, Object * > | ObjectEvent |
| Event when adding removing child objects. More... | |
| typedef Event1< Clock * > | TickEvent |
| typedef Callback1< Object * > | TraverseCallback |
Public Member Functions | |
| void | addCallback (const Callback *callback) |
| Add a callback to the event. More... | |
| void | addCallbackFirst (const Callback *callback) |
| Add a callback to the front of the callback list. More... | |
| void | addEvent (agx::Clock::Event *event) |
| Add an event to the clock to be triggered as specified by the event. More... | |
| void | addFrameJob (agx::Job *job) |
| Add a job to be executed on each tick. More... | |
| void | addFrameTask (agx::Task *task) |
| Add a task to be executed on each tick. More... | |
| void | addListener (EventListener *listener) |
| virtual void | addObject (agx::Object *object, bool assignContext=true) |
| Add an object to the component. More... | |
| void | addSlave (agx::Clock *slave) |
| Add a slave clock, to be driven by this clock. More... | |
| AGX_DECLARE_VECTOR_TYPES (FrameWrapper) | |
| AGX_DECLARE_VECTOR_TYPES (Event) | |
| 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 String | autoComplete (const String &partialName, StringVector &matchingNames) const |
| void | bind (const agx::Path &path) |
| Bind the clock to a reference clock using a bindpath. More... | |
| virtual void | buildNavigationTree (agxJson::Value &eNode) const override |
| virtual void | configure (TiXmlElement *eClock) override |
| void | configure (Model *model) |
| virtual void | configure (TiXmlElement *eEvent) override |
| bool | containsCallback (const Callback *callback) const |
| Event (const agx::Name &name="Event") | |
| Constructor. More... | |
| Event (const agx::Callback &callback, agx::Real startDelay, agx::Real interval=-1.0) | |
| agx::String | fullName () const |
| agx::String | fullPath () const |
| agx::String | fullPath (const agx::Object *root) 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 |
| template<typename T > | |
| T * | getAutoScopedResource (const agx::Path &path) |
| template<typename T > | |
| const T * | getAutoScopedResource (const agx::Path &path) const |
| const agx::Path & | getBindPath () const |
| const CallbackPtrVector & | getCallbacks () const |
| agx::Clock * | getClock () |
| agx::Object * | getContext () |
| const agx::Object * | getContext () const |
| template<typename T > | |
| T * | getContext () |
| template<typename T > | |
| const T * | getContext () const |
| agx::Device * | getDevice () |
| const agx::Device * | getDevice () const |
| template<typename T > | |
| T * | getDevice () |
| template<typename T > | |
| const T * | getDevice () const |
| agx::UInt | getFrame () const |
| agx::Real | getFrequency () const |
| agx::UInt32 | getId () const |
| const agx::Name & | getImplementationName () const |
| size_t | getIndex () const |
| agx::Real | getInterval () const |
| Get the trigger interval. More... | |
| bool | getIsThreadTimelineResponsible () const |
| agx::Model * | getModel () |
| const agx::Model * | getModel () const |
| const agx::Name & | getName () const |
| const agx::Name & | getName () const |
| agx::Object * | getNextSibling () |
| const agx::Object * | getNextSibling () const |
| size_t | getNumObjects (const agx::Name &name) const |
| agx::Object * | getObject (const agx::Name &name, size_t index=0) |
| const agx::Object * | getObject (const agx::Name &name, 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, agx::Model *model, size_t index=0) const |
| template<typename T > | |
| T * | getObject (const agx::Name &name, size_t index=0) |
| 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 |
| void | getObjects (agx::ObjectPtrVector &result, const agx::Model *model, bool recursive=false) const |
| template<typename T > | |
| void | getObjects (ObjectPtrVector &result, bool recursive) const |
| agx::Path | getPath () const |
| agx::Path | getPath (const agx::Object *root) const |
| agx::Clock * | getReference () |
| int | getReferenceCount () 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 |
| template<typename T > | |
| T * | getResource (const agx::Path &path) |
| template<typename T > | |
| const T * | getResource (const agx::Path &path) const |
| virtual Object * | getResourceImpl (const Path &path, agx::Model *model) override |
| agx::Object * | getRootContext () |
| const agx::Object * | getRootContext () const |
| const agx::ClockPtrVector & | getSlaves () const |
| agx::Real | getStartDelay () const |
| agx::Real | getTime () const |
| agx::Real | getTimeModulation () const |
| agx::Real | getTimeStep () const |
| bool | hasListener (EventListener *listener) |
| bool | hasParent (const agx::Object *node) const |
| template<typename T > | |
| bool | is () const |
| Subclass test. More... | |
| agx::Bool | isEnabled () const |
| bool | isRepeating () const |
| bool | isUnique () const |
| virtual void | printSubtree () const override |
| void | printSubtree (std::ostream &stream, int depth=0) const |
| virtual void | rebind () override |
| 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... | |
| void | removeAllCallbacks () |
| Remove all callbacks. More... | |
| void | removeAllObjects () |
| Remove all components. More... | |
| bool | removeCallback (const Callback *callback) |
| void | removeEvent (agx::Clock::Event *event) |
| Remove an event from the clock. More... | |
| void | removeFrameJob (agx::Job *job) |
| Remove a frame job. More... | |
| void | removeFrameTask (agx::Task *task) |
| Remove a frame task. More... | |
| void | removeListener (EventListener *listener) |
| virtual void | removeObject (agx::Object *object) |
| Remove an object from the component. More... | |
| void | removeObject (const agx::Name &name, size_t index=0) |
| Remove an object with a specified name (and optional index) from the component. More... | |
| void | removeSlave (agx::Clock *slave) |
| Remove a slave clock. More... | |
| void | reset () |
| Reset to frame zero (and time=0), remove all events. More... | |
| void | reset () |
| Reset event, with start delay. More... | |
| virtual void | save (TiXmlElement *eParent) const override |
| virtual void | setContext (agx::Object *context) |
| void | setEnable (agx::Bool flag) |
| Set to false to disable the clock, tick will be void operation. More... | |
| void | setEnable (bool flag) |
| Pause/unpause. More... | |
| void | setFrame (UInt frame) |
| Explicitly set the current frame index. More... | |
| void | setFrequency (agx::Real frequency) |
| Set the clock frequency. More... | |
| void | setId (UInt32 id) |
| void | setInterval (agx::Real interval) |
| Set the trigger interval. More... | |
| void | setIsThreadTimelineResponsible (bool isResponsible) |
| Control whether this Clock is the main clock for thread timeline generation. More... | |
| void | setModel (agx::Model *model) |
| Set the object model (handled automatically). More... | |
| void | setName (const agx::Name &name) |
| Set the name of the object. More... | |
| void | setRepeating (bool flag) |
| Set if event trigger multiple times. More... | |
| void | setStartDelay (agx::Real time) |
| Set the start delay when added to a clock or reset. More... | |
| void | setTime (agx::Real64 time) |
| Set the time explicitly, without ticking. More... | |
| void | setTimeModulation (agx::Real modulation) |
| Set the time modulation of the clock, default is 1.0. More... | |
| bool | setTimeStep (agx::Real dt) |
| Set the time step of the clock, 1/frequency. More... | |
| virtual void | snapshot (TiXmlNode *eParent, const String &directory) const override |
| void | start () |
| Same as setEnable(true) More... | |
| void | stepForward (agx::Real delta) |
| Advance the clock a specified interval. More... | |
| void | stepTo (agx::Real time) |
| Advance the clock to a specified time. More... | |
| void | stop () |
| Same as setEnable(false) More... | |
| void | tick () |
| void | tick (bool blocking=true) |
| Advance the clock to the next time step. More... | |
| void | traverse (const TraverseCallback &callback) |
| void | traverse (ComponentVisitor *) |
| void | trigger () |
| Trigger the event. More... | |
| 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 | |
| static Component * | _load (TiXmlElement *eComponent, Device *device) |
| static agx::Model * | ClassModel () |
| 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. More... | |
| static RealTimeClock * | instance () |
| static Clock * | load (TiXmlElement *eClock, Device *device) |
| 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 (const Path &path, const Name &implementation, Device *device, const Path &_namespace=Path()) |
| static Object * | load (const String &path, Device *device, const String &type="", size_t instance=0) |
| static Object * | load (const String &path, Device *device, const String &type, const String &attribute, const String &value) |
| static void | load (const String &path, Device *device, ObjectPtrVector &loadedObjects) |
| static Clock::Event * | load (TiXmlElement *eEvent, 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). More... | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Public Attributes | |
| ObjectEvent | addObjectEvent |
| TickEvent | postTick |
| TickEvent | preTick |
| ObjectEvent | removeObjectEvent |
Protected Member Functions | |
| RealTimeClock (const Name &name, Real frequency=720) | |
| virtual | ~RealTimeClock () |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
| String | expandAutoCompletionMatch (const String &query, const StringVector &matchingNames) const |
| void | setDevice (Device *device) |
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 | |
| Thread * | m_activeThread |
| CallbackPtrVector | m_callbacks |
| agx::UInt32 | m_iterationIndex |
| Mutex | m_mutex |
| Name | m_name |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
Definition at line 27 of file RealTimeClock.h.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Event when adding removing child objects.
NOTE: Events are triggered recursively up the parent structure Example: B is added to root node A, one event is triggered (A.addObjectEvent(A, B)). Then when C is added to B two events are triggered (B.addObjectEvent(B, C), and A.addObjectEvent(B,C))
Definition at line 61 of file Component.h.
|
inherited |
|
inherited |
Definition at line 141 of file Component.h.
|
protectedvirtual |
|
staticinherited |
|
inherited |
Add a callback to the event.
|
inherited |
Add a callback to the front of the callback list.
|
inherited |
Add an event to the clock to be triggered as specified by the event.
| event | The event |
Add a job to be executed on each tick.
| job | The job |
Add a task to be executed on each tick.
| task | The task |
|
inherited |
|
virtualinherited |
Add an object to the component.
| object | The object to be added |
| assignContext | True if the child get the component as the context, set to false to allow 'weak' coupled children |
|
inherited |
Add a slave clock, to be driven by this clock.
| slave | The slave clock |
|
inherited |
|
inherited |
|
protectedinherited |
|
inherited |
Subclass casting.
Template type must match actual type, dynamic_cast assertion will fail otherwise.
Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), and agx::InternalData::getOrCreate().
|
inherited |
|
inherited |
Safe subclass casting, return nullptr if template type does not match.
Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().
|
inherited |
|
virtualinherited |
Reimplemented in agx::Namespace.
Bind the clock to a reference clock using a bindpath.
|
overridevirtualinherited |
Reimplemented from agx::Object.
Reimplemented in agxData::Buffer, and agx::Model.
|
staticinherited |
|
staticinherited |
|
overridevirtualinherited |
Reimplemented from agx::Component.
|
overridevirtualinherited |
Reimplemented from agx::Component.
|
inherited |
|
protectedinherited |
|
inherited |
Constructor.
|
inherited |
|
protectedinherited |
|
inherited |
Referenced by agx::ScalarParameter::get(), agx::ArrayParameter::get(), agxData::Buffer::getArray(), and agxData::Buffer::getElement().
|
inherited |
|
inherited |
|
staticinherited |
|
inherited |
Referenced by agx::Object::getAutoScopedResource().
|
inherited |
|
inherited |
Definition at line 428 of file Object.h.
References agx::Object::getAutoScopedResource(), and agx::Referenced::is().
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Definition at line 373 of file Object.h.
Referenced by agxData::Value::get(), and agx::Model::getNamespace().
|
inherited |
|
inherited |
|
staticprotectedinherited |
|
inherited |
Definition at line 222 of file Component.h.
Referenced by agx::Component::getDevice().
|
inherited |
Definition at line 223 of file Component.h.
References agx::Component::getDevice().
|
inherited |
|
inherited |
|
staticinherited |
Should rebinding be allowed? Right now a global setting.
|
inherited |
|
inherited |
|
inherited |
Definition at line 370 of file Object.h.
Referenced by agxData::EntityStorage::indexToId().
|
inherited |
|
inherited |
|
inherited |
Get the trigger interval.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Definition at line 369 of file Object.h.
Referenced by agxData::Value::get(), agxData::EntityStorage::get(), agxData::FormatBinding< T >::getFormat(), and agxData::EntityPtr::operator()().
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Definition at line 194 of file Component.h.
Referenced by agxData::EntityPtr::operator()().
|
inherited |
Definition at line 195 of file Component.h.
|
inherited |
Definition at line 197 of file Component.h.
|
inherited |
Definition at line 198 of file Component.h.
|
inherited |
|
inherited |
|
inherited |
Definition at line 192 of file Component.h.
Referenced by agx::Component::getObjects().
|
inherited |
|
inherited |
|
inherited |
Definition at line 241 of file Component.h.
References agx::Component::getObjects().
|
inherited |
Referenced by agxData::EntityStorage::dereferenceMultipliedAttribute(), agx::ScalarParameter::get(), agx::ArrayParameter::get(), agx::PointerParameter::get(), agxData::EntityInstance::verifyIndex(), and agxData::EntityPtr::verifyIndex().
|
inherited |
| root | A node along the parent path from this object. |
|
inherited |
|
inherited |
|
inherited |
Referenced by agx::Object::getResource().
|
inherited |
|
inherited |
Definition at line 414 of file Object.h.
References agx::Object::getResource(), and agx::Referenced::is().
|
inherited |
|
overridevirtualinherited |
Reimplemented from agx::Object.
Reimplemented in agx::Task, and agxData::EntityStorage.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Referenced by agxSDK::Simulation::getTimeStamp().
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
static |
|
inherited |
Subclass test.
Referenced by agx::Object::getAutoScopedResource(), agxData::Buffer::getElement(), and agx::Object::getResource().
|
inherited |
|
inherited |
|
staticinherited |
|
staticinherited |
|
staticinherited |
|
staticinherited |
Definition at line 379 of file Object.h.
References agx::Object::load().
|
staticinherited |
Definition at line 386 of file Object.h.
References agx::Object::load().
|
staticinherited |
|
staticinherited |
|
staticinherited |
|
overridevirtualinherited |
Reimplemented from agx::Object.
|
inherited |
|
overridevirtualinherited |
Reimplemented from agx::Component.
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.
Referenced by agxData::Val< UInt >::Val().
|
inherited |
Remove all callbacks.
|
inherited |
Remove all components.
|
inherited |
|
inherited |
Remove an event from the clock.
| event | The event |
Remove a frame job.
| job | The job |
Remove a frame task.
| task | The task |
|
inherited |
|
virtualinherited |
Remove an object from the component.
Remove an object with a specified name (and optional index) from the component.
|
inherited |
Remove a slave clock.
| slave | The slave clock |
|
inherited |
Reset to frame zero (and time=0), remove all events.
|
inherited |
Reset event, with start delay.
|
overridevirtualinherited |
Reimplemented from agx::Object.
|
virtualinherited |
Reimplemented in agx::Task, and agxData::FunctionValue.
|
staticprotectedinherited |
Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
Set to false to disable the clock, tick will be void operation.
|
inherited |
Pause/unpause.
|
staticinherited |
Sets if rebinding of objects should be allowed (Right now a global setting).
Allowing it when adding larger parts to the system tree might hit performance, so it might be smarter to disable it first, then add, and then enable again.
|
inherited |
Control whether this Clock is the main clock for thread timeline generation.
Default is true. Set to false for example when using a sub-simulation that is stepped from within the main simulation.
|
inherited |
Set the object model (handled automatically).
|
inherited |
Set if event trigger multiple times.
Set the start delay when added to a clock or reset.
| time | - in seconds |
|
inherited |
Set the time explicitly, without ticking.
Set the time modulation of the clock, default is 1.0.
|
inherited |
Set the time step of the clock, 1/frequency.
|
overridevirtualinherited |
Reimplemented from agx::Object.
|
inherited |
Same as setEnable(true)
Advance the clock a specified interval.
| delta | The interval |
Advance the clock to a specified time.
| time | The specified time |
|
inherited |
Same as setEnable(false)
| void agx::RealTimeClock::tick | ( | ) |
|
inherited |
Advance the clock to the next time step.
| blocking | Will wait for all tick tasks if true |
|
inherited |
|
inherited |
|
inherited |
Trigger the event.
Definition at line 235 of file Event.h.
References AGX_EVENT_TRIGGER_END, AGX_EVENT_TRIGGER_START, agx::VectorPOD< T, Allocator >::back(), INDEX, agx::Callback::isRepeating(), agx::EventT< Callback >::m_callbacks, agx::VectorPOD< T, Allocator >::pop_back(), agx::Callback::run(), and agx::Container::size().
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.
|
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.
|
staticinherited |
|
inherited |
Definition at line 63 of file Component.h.
|
protectedinherited |
|
protectedinherited |
Definition at line 80 of file Event.h.
Referenced by agx::Event::trigger().
|
protectedinherited |
|
mutableprotectedinherited |
Definition at line 240 of file Referenced.h.
|
protectedinherited |
|
mutableprotectedinherited |
Definition at line 239 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 241 of file Referenced.h.
|
inherited |
Definition at line 64 of file Component.h.