105 virtual void save(TiXmlElement* )
const {}
110 template <
typename T>
111 static T *load(TiXmlElement *eObject,
Device *device);
129 template <
typename T>
130 static T *load(
const String& path,
Device *device,
const String& type =
"",
size_t instance = 0);
132 template <
typename T>
231 template <
typename T>
234 template <
typename T>
235 const T *getContext()
const;
237 template <
typename T>
240 template <
typename T>
241 const T *getResource(
const agx::Path& path)
const;
243 template <
typename T>
244 T *getAutoScopedResource(
const agx::Path& path);
246 template <
typename T>
247 const T *getAutoScopedResource(
const agx::Path& path)
const;
252 bool isUnique()
const;
276 static bool g_shouldRebind;
284 EventDispatch *m_eventDispatch;
302 template <
typename T>
305 template <
typename T>
333 #define AGX_MODEL_IMPLEMENTATION(_class, _path) \
334 agx::Model *_class::ClassModel() \
336 ScopeLock<ReentrantMutex> lock(agx::getTypeSystemMutex()); \
337 static agx::Model *s_model = nullptr; \
340 agx::createImplementedModel(_path, s_model); \
343 LOGGER_ERROR() << agx::String::format("No model found for path \'%s\'. Make sure AGX environment is properly setup", _path) << LOGGER_ENDL(); \
348 #define AGX_BUILTIN_MODEL(_class, _path, _parent) \
349 agx::Model *_class::ClassModel() \
351 ScopeLock<ReentrantMutex> lock(agx::getTypeSystemMutex()); \
352 static agx::Model *s_model = nullptr; \
355 agx::createBuiltinModel(_path, _parent, s_model); \
363 template <
typename T>
366 template <
typename T>
378 template <
typename T>
382 return dynamic_cast<T *
>(object);
385 template <
typename T>
389 return dynamic_cast<T *
>(object);
392 template <
typename T>
396 return dynamic_cast<T *
>(object);
400 template <
typename T>
406 template <
typename T>
409 return dynamic_cast<const T *
>(this->
getContext());
413 template <
typename T>
417 return (
object !=
nullptr && object->
is<T>()) ?
object->as<T>() :
nullptr;
420 template <
typename T>
423 return const_cast<Object *
>(
this)->getResource<T>(path);
427 template <
typename T>
431 return (
object !=
nullptr && object->
is<T>()) ?
object->as<T>() :
nullptr;
434 template <
typename T>
437 return const_cast<Object *
>(
this)->getAutoScopedResource<T>(path);
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGX_DECLARE_VECTOR_TYPES(type)
A component is an object containing other objects, enabling hierarchical structuring.
An agx::Device is an abstract representation of a device on which data can be stored and processed.
Inheritance with partial specialization due to bug with ref_ptr containers.
Inheritance with partial specialization due to bug with ref_ptr containers.
A model is an abstract representation of the class of an agx::Object.
Representation of a name string.
agx::Object is a refcounted object with a name.
agx::Path getPath() const
virtual void snapshot(TiXmlNode *, const String &) const
static const HashSet< Object * > & getActiveObjects()
agx::String fullName() const
static Object * load(const String &path, Device *device, const String &type, const String &attribute, const String &value)
virtual void configure(TiXmlElement *)
static agx::String generateName(const agx::String &bindPath)
virtual agx::Object * getResourceImpl(const agx::Path &path, agx::Model *model)
agx::Path getPath(const agx::Object *root) const
void setModel(agx::Model *model)
Set the object model (handled automatically).
void addListener(EventListener *listener)
const agx::Name & getName() const
static void setEnableRebind(bool flag)
Sets if rebinding of objects should be allowed (Right now a global setting).
Object(const Name &name=Name(), Model *model=Object::ClassModel())
virtual void setContext(agx::Object *context)
virtual void printSubtree() const
virtual void save(TiXmlElement *) const
agx::Object * getContext()
void removeListener(EventListener *listener)
bool hasParent(const agx::Object *node) 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
agx::UInt32 getId() const
const agx::Object * getRootContext() const
void setName(const agx::Name &name)
Set the name of the object.
static agx::Model * ClassModel()
static bool getEnableRebind()
Should rebinding be allowed? Right now a global setting.
static void load(const String &path, Device *device, ObjectPtrVector &loadedObjects)
virtual void buildNavigationTree(agxJson::Value &eNode) const
agx::String fullPath(const agx::Object *root) const
agx::Object * getNextSibling()
static Object * load(const String &path, Device *device, const String &type="", size_t instance=0)
agx::Object * getRootContext()
const agx::Name & getImplementationName() const
const agx::Object * getAutoScopedResource(const agx::Path &path, agx::Model *model=nullptr) const
const agx::Object * getNextSibling() const
static TiXmlDocument openDocument(const String &path)
static Object * load(TiXmlElement *eObject, Device *device)
agx::String fullPath() const
agx::Object * getAutoScopedResource(const agx::Path &path, agx::Model *model=nullptr)
bool hasListener(EventListener *listener)
Representation of a path, a list of name components.
A pointer to an agx::Object.
Base class providing referencing counted objects.
bool is() const
Subclass test.
Vector containing 'raw' data.
Contains classes for low level data storage for AGX.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
AGXCORE_EXPORT void createBuiltinModel(const char *path, Model *parent, Model *&result)
AGXCORE_EXPORT Component * root()
AGXCORE_EXPORT void printNode(const char *path)
Debugging.
AGX_DECLARE_HASHSET_TYPES(Object)
std::recursive_mutex ReentrantMutex
AGXCORE_EXPORT void createImplementedModel(const char *path, Model *&result)
AGXCORE_EXPORT agx::ReentrantMutex & getTypeSystemMutex()
HashTable< Name, Object * > ObjectPtrTable
AGXCORE_EXPORT Model * getModel(const Path &path, const Path &_namespace=Path())