|
AGXDynamics
2.31.1.0
|
Abstract representation of a value. More...
#include <Value.h>
Inheritance diagram for agxData::Value:Public Types | |
| typedef agx::Event1< Value * > | Event |
| 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 |
Public Member Functions | |
| Value (const agx::Name &name, const agxData::Type *type) | |
| Value (const agx::Name &name, const agxData::Format *format) | |
| Value (const agxData::Type *type) | |
| Value (const agxData::Format *format) | |
| void | addListener (EventListener *listener) |
| 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 |
| void | bind (const agx::Path &path) |
| Set bind path which will auto-bind when resolved. More... | |
| void | bind (Value *binding) |
| Explicit binding, also disables auto-binding. More... | |
| virtual void | buildNavigationTree (agxJson::Value &eNode) const override |
| Value * | clone () const |
| virtual void | configure (agx::TiXmlElement *eValue) override |
| virtual void | configure (TiXmlElement *) |
| agx::String | fullName () const |
| agx::String | fullPath () const |
| agx::String | fullPath (const agx::Object *root) const |
| template<typename T > | |
| const T & | get () 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 |
| Value * | getBinding () |
| const Value * | getBinding () const |
| const agx::Path & | getBindPath () const |
| agx::Object * | getContext () |
| const agx::Object * | getContext () const |
| template<typename T > | |
| T * | getContext () |
| template<typename T > | |
| const T * | getContext () const |
| virtual agxData::Data * | getData () |
| agxData::Format * | getFormat () |
| const agxData::Format * | getFormat () 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 |
| 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 agx::Object * | getResourceImpl (const agx::Path &path, agx::Model *model) |
| Value * | getRootBinding () |
| const Value * | getRootBinding () const |
| agx::Object * | getRootContext () |
| const agx::Object * | getRootContext () const |
| agxData::Type * | getType () |
| const agxData::Type * | getType () const |
| bool | hasListener (EventListener *listener) |
| bool | hasParent (const agx::Object *node) const |
| template<typename T > | |
| bool | is () const |
| Subclass test. More... | |
| bool | isTypeCompatible (const Value *other) |
| bool | isUnique () const |
| bool | isValid () const |
| void | print () const |
| virtual void | printSubtree () const |
| const void * | ptr () const |
| void * | ptr () |
| virtual void | rebind () override |
| Rebind with the current auto-bind path. More... | |
| 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 | removeListener (EventListener *listener) |
| virtual void | save (agx::TiXmlElement *eParent) const override |
| virtual void | save (TiXmlElement *) const |
| void | set (const Value *other) |
| Explicitly set the value, removes active binding and disables autobinding. More... | |
| template<typename T > | |
| void | set (const T &value) |
| void | set (Value *other) |
| void | set (ValueRef &other) |
| void | set (const ValueRef &other) |
| virtual void | setContext (agx::Object *context) |
| void | setDefaultValue () |
| Set the default value of the format. More... | |
| void | setExpression (const agx::String &expression) |
| Configure value using an expression. More... | |
| void | setFormat (agxData::Format *format) |
| void | setId (UInt32 id) |
| 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... | |
| template<typename T > | |
| void | signal (const T &value) |
| Wrapper for this->getRootBinding()->set() More... | |
| virtual void | snapshot (agx::TiXmlNode *eParent, const agx::String &directory) const override |
| virtual void | snapshot (TiXmlNode *, const String &) const |
| agx::String | toString () const |
| template<typename T > | |
| T | transform () const |
| void | unbind (bool removeAutoBindPath=true) |
| Unbind, also disables auto-binding. 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 agx::Model * | ClassModel () |
| static void | copy (Value *target, const Value *source) |
| 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 Value * | load (agx::TiXmlElement *eValue, agx::Device *device) |
| static Object * | load (TiXmlElement *eObject, Device *device) |
| 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 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 | |
| Event | updateEvent |
| Triggered when the value is updated. More... | |
Protected Member Functions | |
| virtual | ~Value () |
| void | allocateObserverVector () const |
| virtual bool | bind (Object *object) |
| void | deleteUsingDeleteHandler () const |
| void | forceRemove () |
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 | |
| agx::UInt32 | m_allocationIndex |
| ValueRef | m_binding |
| EventListener | m_bindingListener |
| agx::Path | m_bindPath |
| ValuePtrVector | m_children |
| EventDispatch | m_eventDispatch |
| FormatRef | m_format |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
| bool | m_restartIteration |
| AbstractScalar | m_value |
Abstract representation of a value.
The value has a name and specified format, and since it is an agx::Object it can be inserted as a node in the system hierarchy.
Values can bind to other values, and is automatically synchronized when the reference value is updated.
| typedef agx::Event1<Value *> agxData::Value::Event |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
| agxData::Value::Value | ( | const agx::Name & | name, |
| const agxData::Type * | type | ||
| ) |
| agxData::Value::Value | ( | const agx::Name & | name, |
| const agxData::Format * | format | ||
| ) |
| agxData::Value::Value | ( | const agxData::Type * | type | ) |
| agxData::Value::Value | ( | const agxData::Format * | format | ) |
|
protectedvirtual |
| void agxData::Value::addListener | ( | EventListener * | listener | ) |
|
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 |
Set bind path which will auto-bind when resolved.
|
protectedvirtual |
|
overridevirtual |
Reimplemented from agx::Object.
Reimplemented in agx::Pointer.
|
static |
| Value* agxData::Value::clone | ( | ) | const |
|
overridevirtual |
|
inlinevirtualinherited |
|
protectedinherited |
|
protected |
Referenced by agxData::Val< UInt >::~Val().
|
inherited |
Referenced by agx::ScalarParameter::get(), agx::ArrayParameter::get(), agxData::Buffer::getArray(), and agxData::Buffer::getElement().
|
inherited |
|
inherited |
|
staticinherited |
| const T & agxData::Value::get | ( | ) | const |
Definition at line 325 of file Value.h.
References agxAssert, agxAssertN, agx::Object::getContext(), agx::Object::getName(), agxCore::isShutdown(), isValid(), m_format, m_value, and agxData::Data::ptr().
Referenced by agxSDK::SimulationParameterT< T >::getValue(), agxData::EntityPtr::operator()(), and agxSDK::SimulationParameterT< T >::setValue().
|
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 |
| Value * agxData::Value::getBinding | ( | ) |
| const Value * agxData::Value::getBinding | ( | ) | const |
| const agx::Path & agxData::Value::getBindPath | ( | ) | const |
|
inherited |
Definition at line 373 of file Object.h.
Referenced by get(), and agx::Model::getNamespace().
|
inherited |
|
inherited |
|
virtual |
|
staticprotectedinherited |
|
staticinherited |
Should rebinding be allowed? Right now a global setting.
| agxData::Format * agxData::Value::getFormat | ( | ) |
Definition at line 381 of file Value.h.
References m_format.
Referenced by agxData::ValueT< T >::ValidateCast().
| const agxData::Format * agxData::Value::getFormat | ( | ) | const |
|
inherited |
Definition at line 370 of file Object.h.
Referenced by agxData::EntityStorage::indexToId().
|
inherited |
|
inherited |
|
inherited |
Definition at line 369 of file Object.h.
Referenced by get(), agxData::EntityStorage::get(), agxData::FormatBinding< T >::getFormat(), and agxData::EntityPtr::operator()().
|
inherited |
|
inherited |
|
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 |
Referenced by agx::Object::getResource().
|
inherited |
|
inherited |
Definition at line 414 of file Object.h.
References agx::Object::getResource(), and agx::Referenced::is().
|
inherited |
|
virtualinherited |
| const Value* agxData::Value::getRootBinding | ( | ) | const |
|
inherited |
|
inherited |
| agxData::Type * agxData::Value::getType | ( | ) |
| const agxData::Type * agxData::Value::getType | ( | ) | const |
| bool agxData::Value::hasListener | ( | EventListener * | listener | ) |
|
inherited |
|
inherited |
Subclass test.
Referenced by agx::Object::getAutoScopedResource(), agxData::Buffer::getElement(), and agx::Object::getResource().
| bool agxData::Value::isTypeCompatible | ( | const Value * | other | ) |
| bool agxData::Value::isValid | ( | ) | const |
Definition at line 386 of file Value.h.
References m_value, and agxData::Data::ptr().
Referenced by get().
|
static |
|
staticinherited |
Definition at line 393 of file Object.h.
Referenced by agx::Object::load().
|
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 |
| void agxData::Value::print | ( | ) | const |
|
inlinevirtualinherited |
Reimplemented in agx::Component.
| const void * agxData::Value::ptr | ( | ) | const |
Definition at line 322 of file Value.h.
References m_value, and agxData::Data::ptr().
Referenced by agxData::ValueT< T >::get().
| void * agxData::Value::ptr | ( | ) |
Definition at line 321 of file Value.h.
References m_value, and agxData::Data::ptr().
|
overridevirtual |
Rebind with the current auto-bind path.
Reimplemented from agx::Object.
Reimplemented in agxData::FunctionValue.
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().
| void agxData::Value::removeListener | ( | EventListener * | listener | ) |
|
overridevirtual |
|
inlinevirtualinherited |
Reimplemented in agx::Clock.
Explicitly set the value, removes active binding and disables autobinding.
Referenced by set(), agxData::ValueT< T >::set(), and signal().
| void agxData::Value::set | ( | const T & | value | ) |
Definition at line 356 of file Value.h.
References agxAssert, agxCore::isShutdown(), m_format, set(), and setFormat().
Definition at line 345 of file Value.h.
References agx::ref_ptr< T >::get(), and set().
Definition at line 350 of file Value.h.
References agx::ref_ptr< T >::get(), and set().
|
virtualinherited |
Reimplemented in agx::Task, and agxData::FunctionValue.
| void agxData::Value::setDefaultValue | ( | ) |
Set the default value of the format.
|
staticprotectedinherited |
Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
|
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.
| void agxData::Value::setExpression | ( | const agx::String & | expression | ) |
Configure value using an expression.
Internal use only, deprecated syntax.
| void agxData::Value::setFormat | ( | agxData::Format * | format | ) |
Referenced by set().
|
inherited |
Set the object model (handled automatically).
| void agxData::Value::signal | ( | const T & | value | ) |
Wrapper for this->getRootBinding()->set()
Definition at line 366 of file Value.h.
References getRootBinding(), and set().
Referenced by agxData::ValueT< T >::signal().
|
overridevirtual |
Reimplemented in agx::Component.
| agx::String agxData::Value::toString | ( | ) | const |
|
inline |
Definition at line 333 of file Value.h.
References m_format, m_value, agxData::Data::ptr(), and agxData::transform().
Referenced by agxOSG::CameraSynchronization::operator()().
| void agxData::Value::unbind | ( | bool | removeAutoBindPath = true | ) |
Unbind, also disables auto-binding.
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 |
|
protected |
|
protected |
Definition at line 212 of file Value.h.
Referenced by getBinding().
|
protected |
Definition at line 211 of file Value.h.
Referenced by getBindPath().
|
protected |
Definition at line 215 of file Value.h.
Referenced by get(), getFormat(), getType(), set(), and transform().
|
mutableprotectedinherited |
Definition at line 240 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 239 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 241 of file Referenced.h.
|
protected |
| Event agxData::Value::updateEvent |