AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agx::UnresolvedParameter Class Reference

Unresolved parameter. More...

#include <Parameter.h>

+ Inheritance diagram for agx::UnresolvedParameter:

Public Types

typedef Event1< Parameter * > 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
 
enum  MetaType {
  SCALAR, ARRAY, POINTER, ENTITY_DATA,
  ENTITY_PTR, ENTITY_INSTANCE, UNRESOLVED
}
 Specify which kind of parameter. More...
 

Public Member Functions

 UnresolvedParameter (const agx::Name &name, const agx::String &expression)
 
 UnresolvedParameter (const agx::Name &name, MetaType type, const agx::String &expression)
 
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 (agx::Object *binding)
 Set explicit binding. More...
 
void bind (const agx::Path &path)
 Set parameter bind path. More...
 
virtual void buildNavigationTree (agxJson::Value &eNode) const
 
virtual void configure (TiXmlElement *eParameter) override
 
agx::String fullName () const
 
agx::String fullPath () const
 
agx::String fullPath (const agx::Object *root) const
 
UInt8 getAccessMode () 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
 
agx::Object * getBinding ()
 
const agx::Object * 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
 
agxData::Format * getFormat ()
 
const agxData::Format * getFormat () const
 
agx::UInt32 getId () const
 
const agx::Name & getImplementationName () const
 
size_t getIndex () const
 
MetaType getMetaType () const
 
const agx::String & getMetaTypeName () 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 Object * getResourceImpl (const Path &path, agx::Model *model) override
 
agx::Object * getRootContext ()
 
const agx::Object * getRootContext () const
 
agx::Task * getTask ()
 
const agx::Task * getTask () const
 
agxData::Type * getType () override
 
const agxData::Type * getType () const override
 
virtual bool hasGlobalResult () const
 
bool hasListener (EventListener *listener)
 
bool hasParent (const agx::Object *node) const
 
template<typename T >
bool is () const
 Subclass test. More...
 
bool isRequired () const
 
bool isUnique () const
 
virtual bool isValid () const override
 
bool needCommit ()
 
bool needUpdate ()
 
virtual void printSubtree () 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 removeListener (EventListener *listener)
 
virtual void save (TiXmlElement *) const
 
void set (agx::Object *binding)
 Set the parameter, alias for bind. More...
 
virtual void setContext (agx::Object *context)
 
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...
 
void setRequired (bool flag)
 Set if the parameter is required, default is true. More...
 
virtual void snapshot (TiXmlNode *, const String &) const
 
void unbind ()
 Remove current binding and bind path. 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 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 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 UnresolvedParameter * load (TiXmlElement *eParameter, 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

Event bindEvent
 
Event unbindEvent
 
Event updateEvent
 

Protected Member Functions

virtual ~UnresolvedParameter ()
 
virtual void _bind (Object *binding) override
 
void allocateObserverVector () const
 
virtual void commit () override
 
void deleteUsingDeleteHandler () const
 
void init (const String &expression)
 
void triggerUpdateCallback (agxData::Value *value)
 
virtual void update () override
 

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

const UInt8 m_accessMode
 
ObjectObserver m_binding
 
Path m_bindPath
 
agxData::FormatRef m_format
 
size_t m_index
 
UInt8 m_metaType
 
Mutex m_mutex
 
bool m_needCommit
 
bool m_needUpdate
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 
bool m_required
 
Task * m_task
 

Detailed Description

Unresolved parameter.

Definition at line 215 of file Parameter.h.

Member Typedef Documentation

typedef Event1<Parameter *> agx::Parameter::Event
inherited

Definition at line 66 of file Parameter.h.

Definition at line 62 of file Object.h.

typedef agx::ref_ptr< const Event > agx::Object::EventConstRef
inherited

Definition at line 62 of file Object.h.

Definition at line 62 of file Object.h.

Definition at line 62 of file Object.h.

Member Enumeration Documentation

enum agx::Parameter::MetaType
inherited

Specify which kind of parameter.

Enumerator
SCALAR 
ARRAY 
POINTER 
ENTITY_DATA 
ENTITY_PTR 
ENTITY_INSTANCE 
UNRESOLVED 

Definition at line 72 of file Parameter.h.

Constructor & Destructor Documentation

agx::UnresolvedParameter::UnresolvedParameter ( const agx::Name &  name,
const agx::String &  expression 
)
agx::UnresolvedParameter::UnresolvedParameter ( const agx::Name &  name,
MetaType  type,
const agx::String &  expression 
)
virtual agx::UnresolvedParameter::~UnresolvedParameter ( )
protectedvirtual

Member Function Documentation

virtual void agx::UnresolvedParameter::_bind ( Object *  binding)
overrideprotectedvirtual

Implements agx::Parameter.

void agx::Object::addListener ( EventListener *  listener)
inherited
agx::Object::AGX_DECLARE_VECTOR_TYPES ( Event  )
inherited
void agx::Referenced::allocateObserverVector ( ) const
protectedinherited
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(), and agx::InternalData::getOrCreate().

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

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

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

template<typename T >
const T* agx::Referenced::asSafe ( ) const
inherited
void agx::Parameter::bind ( agx::Object *  binding)
inherited

Set explicit binding.

void agx::Parameter::bind ( const agx::Path &  path)
inherited

Set parameter bind path.

virtual void agx::Object::buildNavigationTree ( agxJson::Value &  eNode) const
virtualinherited
static agx::Model* agx::UnresolvedParameter::ClassModel ( )
static
virtual void agx::UnresolvedParameter::commit ( )
overrideprotectedvirtual

Implements agx::Parameter.

virtual void agx::UnresolvedParameter::configure ( TiXmlElement *  eParameter)
overridevirtual

Reimplemented from agx::Object.

void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited
agx::String agx::Object::fullName ( ) const
inherited
agx::String agx::Object::fullPath ( ) const
inherited
Returns
path:implementation
agx::String agx::Object::fullPath ( const agx::Object *  root) const
inherited
static agx::String agx::Object::generateName ( const agx::String &  bindPath)
staticinherited
UInt8 agx::Parameter::getAccessMode ( ) const
inherited
Returns
The access mode of the parameter.

Definition at line 702 of file Parameter.h.

References agx::Parameter::m_accessMode.

static const HashSet<Object *>& agx::Object::getActiveObjects ( )
staticinherited
agx::Object* agx::Object::getAutoScopedResource ( const agx::Path &  path,
agx::Model *  model = nullptr 
)
inherited
Returns
The resource with the first matching subpath starting from this node and traversing upwards to the root.

Referenced by agx::Object::getAutoScopedResource().

const agx::Object* agx::Object::getAutoScopedResource ( const agx::Path &  path,
agx::Model *  model = nullptr 
) const
inherited
template<typename T >
T * agx::Object::getAutoScopedResource ( const agx::Path &  path)
inherited

Definition at line 428 of file Object.h.

References agx::Object::getAutoScopedResource(), and agx::Referenced::is().

template<typename T >
const T * agx::Object::getAutoScopedResource ( const agx::Path &  path) const
inherited

Definition at line 435 of file Object.h.

Object * agx::Parameter::getBinding ( )
inherited
Returns
The current parameter binding.

Definition at line 704 of file Parameter.h.

References agx::Parameter::m_binding.

const Object * agx::Parameter::getBinding ( ) const
inherited

Definition at line 705 of file Parameter.h.

References agx::Parameter::m_binding.

const Path & agx::Parameter::getBindPath ( ) const
inherited
Returns
The bind path of the parameter.

Definition at line 703 of file Parameter.h.

References agx::Parameter::m_bindPath.

T * agx::Object::getContext ( )
inherited
Returns
The parent node in the system tree.

Definition at line 373 of file Object.h.

Referenced by agxData::Value::get(), and agx::Model::getNamespace().

const T * agx::Object::getContext ( ) const
inherited

Definition at line 374 of file Object.h.

template<typename T >
T* agx::Object::getContext ( )
inherited
template<typename T >
const T* agx::Object::getContext ( ) const
inherited
static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.
static bool agx::Object::getEnableRebind ( )
staticinherited

Should rebinding be allowed? Right now a global setting.

agxData::Format * agx::Parameter::getFormat ( )
inherited
Returns
The parameter format.

Definition at line 700 of file Parameter.h.

References agx::Parameter::m_format.

const agxData::Format * agx::Parameter::getFormat ( ) const
inherited

Definition at line 701 of file Parameter.h.

References agx::Parameter::m_format.

UInt32 agx::Object::getId ( ) const
inherited
Returns
The global object id.

Definition at line 370 of file Object.h.

Referenced by agxData::EntityStorage::indexToId().

const agx::Name& agx::Object::getImplementationName ( ) const
inherited
Returns
The implementation name of the model. Alias for getModel()->getImplementationName()
size_t agx::Parameter::getIndex ( ) const
inherited
Returns
The parameter index.

Definition at line 697 of file Parameter.h.

References agx::Parameter::m_index.

Parameter::MetaType agx::Parameter::getMetaType ( ) const
inherited
Returns
The parameter meta type.

Definition at line 698 of file Parameter.h.

References agx::Parameter::m_metaType.

const agx::String& agx::Parameter::getMetaTypeName ( ) const
inherited
Returns
The parameter meta type as a string.
Model * agx::Object::getModel ( )
inherited
Returns
The object model.

Definition at line 371 of file Object.h.

const Model * agx::Object::getModel ( ) const
inherited

Definition at line 372 of file Object.h.

const Name & agx::Object::getName ( ) const
inherited
Returns
Then name of the object.

Definition at line 369 of file Object.h.

Referenced by agxData::Value::get(), agxData::EntityStorage::get(), agxData::FormatBinding< T >::getFormat(), and agxData::EntityPtr::operator()().

agx::Object* agx::Object::getNextSibling ( )
inherited
Returns
The next sibling with identical name.
const agx::Object* agx::Object::getNextSibling ( ) const
inherited
agx::Path agx::Object::getPath ( const agx::Object *  root) const
inherited
Returns
A relative path from a specified root
Parameters
rootA node along the parent path from this object.
int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.
agx::Object* agx::Object::getResource ( const agx::Path &  path,
agx::Model *  model = nullptr 
)
inherited
Returns
A resource in the subtree below this object.

Referenced by agx::Object::getResource().

const agx::Object* agx::Object::getResource ( const agx::Path &  path,
agx::Model *  model = nullptr 
) const
inherited
template<typename T >
T * agx::Object::getResource ( const agx::Path &  path)
inherited

Definition at line 414 of file Object.h.

References agx::Object::getResource(), and agx::Referenced::is().

template<typename T >
const T * agx::Object::getResource ( const agx::Path &  path) const
inherited

Definition at line 421 of file Object.h.

virtual Object* agx::Parameter::getResourceImpl ( const Path &  path,
agx::Model *  model 
)
overridevirtualinherited
agx::Object* agx::Object::getRootContext ( )
inherited
Returns
The root context.
const agx::Object* agx::Object::getRootContext ( ) const
inherited
Task * agx::Parameter::getTask ( )
inherited
Returns
The task in which the parameter list contain this parameter.

Definition at line 695 of file Parameter.h.

References agx::Parameter::m_task.

const Task * agx::Parameter::getTask ( ) const
inherited

Definition at line 696 of file Parameter.h.

References agx::Parameter::m_task.

agxData::Type* agx::UnresolvedParameter::getType ( )
overridevirtual
Returns
The parameter type.

Reimplemented from agx::Parameter.

const agxData::Type* agx::UnresolvedParameter::getType ( ) const
overridevirtual

Reimplemented from agx::Parameter.

virtual bool agx::Parameter::hasGlobalResult ( ) const
virtualinherited
Returns
True if the parameter has a global result

Reimplemented in agx::EntityDataParameter, and agx::ArrayParameter.

bool agx::Object::hasListener ( EventListener *  listener)
inherited
bool agx::Object::hasParent ( const agx::Object *  node) const
inherited
Returns
True if the specified node is located somewhere in the path above the object.
void agx::UnresolvedParameter::init ( const String &  expression)
protected
template<typename T >
bool agx::Referenced::is ( ) const
inherited
bool agx::Parameter::isRequired ( ) const
inherited
Returns
True if the parameter is required.

Definition at line 699 of file Parameter.h.

References agx::Parameter::m_required.

Referenced by agx::PointerParameter::get().

bool agx::Object::isUnique ( ) const
inherited

Definition at line 375 of file Object.h.

virtual bool agx::UnresolvedParameter::isValid ( ) const
overridevirtual
Returns
True if the parameter has a valid binding.

Implements agx::Parameter.

T * agx::Object::load ( const String &  path,
Device *  device,
const String &  type = "",
size_t  instance = 0 
)
staticinherited

Definition at line 379 of file Object.h.

References agx::Object::load().

T * agx::Object::load ( const String &  path,
Device *  device,
const String &  type,
const String &  attribute,
const String &  value 
)
staticinherited

Definition at line 386 of file Object.h.

References agx::Object::load().

static void agx::Object::load ( const String &  path,
Device *  device,
ObjectPtrVector &  loadedObjects 
)
staticinherited
static UnresolvedParameter* agx::UnresolvedParameter::load ( TiXmlElement *  eParameter,
Device *  device 
)
static
bool agx::Parameter::needCommit ( )
inherited

Definition at line 709 of file Parameter.h.

References agx::Parameter::m_needCommit.

bool agx::Parameter::needUpdate ( )
inherited

Definition at line 708 of file Parameter.h.

References agx::Parameter::m_needUpdate.

static TiXmlDocument agx::Object::openDocument ( const String &  path)
staticinherited
virtual void agx::Object::printSubtree ( ) const
inlinevirtualinherited

Reimplemented in agx::Component.

Definition at line 254 of file Object.h.

virtual void agx::Parameter::rebind ( )
overridevirtualinherited

Reimplemented from agx::Object.

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.

Referenced by agxData::Val< UInt >::Val().

void agx::Object::removeListener ( EventListener *  listener)
inherited
virtual void agx::Object::save ( TiXmlElement *  ) const
inlinevirtualinherited

Reimplemented in agx::Clock.

Definition at line 105 of file Object.h.

void agx::Parameter::set ( agx::Object *  binding)
inherited

Set the parameter, alias for bind.

virtual void agx::Object::setContext ( agx::Object *  context)
virtualinherited

Reimplemented in agx::Task, and agxData::FunctionValue.

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

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

static void agx::Object::setEnableRebind ( bool  flag)
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 agx::Object::setId ( UInt32  id)
inherited
void agx::Object::setModel ( agx::Model *  model)
inherited

Set the object model (handled automatically).

void agx::Object::setName ( const agx::Name &  name)
inherited

Set the name of the object.

void agx::Parameter::setRequired ( bool  flag)
inherited

Set if the parameter is required, default is true.

virtual void agx::Object::snapshot ( TiXmlNode *  ,
const String &   
) const
inlinevirtualinherited

Reimplemented in agx::Component.

Definition at line 106 of file Object.h.

void agx::UnresolvedParameter::triggerUpdateCallback ( agxData::Value *  value)
protected
void agx::Parameter::unbind ( )
inherited

Remove current binding and bind path.

Referenced by agx::ScalarParameter::set().

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.

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.

virtual void agx::UnresolvedParameter::update ( )
overrideprotectedvirtual

Implements agx::Parameter.

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

Member Data Documentation

Event agx::Parameter::bindEvent
inherited

Definition at line 67 of file Parameter.h.

const UInt8 agx::Parameter::m_accessMode
protectedinherited

Definition at line 203 of file Parameter.h.

Referenced by agx::Parameter::getAccessMode().

ObjectObserver agx::Parameter::m_binding
protectedinherited
Path agx::Parameter::m_bindPath
protectedinherited

Definition at line 201 of file Parameter.h.

Referenced by agx::Parameter::getBindPath().

agxData::FormatRef agx::Parameter::m_format
protectedinherited
size_t agx::Parameter::m_index
protectedinherited

Definition at line 199 of file Parameter.h.

Referenced by agx::Parameter::getIndex().

UInt8 agx::Parameter::m_metaType
protectedinherited

Definition at line 205 of file Parameter.h.

Referenced by agx::Parameter::getMetaType().

Mutex agx::Referenced::m_mutex
mutableprotectedinherited

Definition at line 240 of file Referenced.h.

bool agx::Parameter::m_needCommit
protectedinherited

Definition at line 207 of file Parameter.h.

Referenced by agx::Parameter::needCommit().

bool agx::Parameter::m_needUpdate
protectedinherited

Definition at line 206 of file Parameter.h.

Referenced by agx::Parameter::needUpdate().

ObserverContainer agx::Referenced::m_observers
mutableprotectedinherited

Definition at line 239 of file Referenced.h.

AtomicValue agx::Referenced::m_refCount
mutableprotectedinherited

Definition at line 241 of file Referenced.h.

bool agx::Parameter::m_required
protectedinherited

Definition at line 204 of file Parameter.h.

Referenced by agx::ArrayParameter::get(), and agx::Parameter::isRequired().

Task* agx::Parameter::m_task
protectedinherited

Definition at line 198 of file Parameter.h.

Referenced by agx::Parameter::getTask().

Event agx::Parameter::unbindEvent
inherited

Definition at line 68 of file Parameter.h.

Event agx::Parameter::updateEvent
inherited

Definition at line 69 of file Parameter.h.


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