AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
Object.h File Reference
#include <agx/Referenced.h>
#include <agx/Name.h>
#include <agx/Path.h>
#include <agx/Vector.h>
#include <agx/HashTable.h>
#include <agx/HashSet.h>
#include <agx/ObjectEvent.Declaration.h>
#include <agx/ObjectEvent.Implementation.h>

Go to the source code of this file.

Classes

class  agx::Object::Event
 
class  agx::Object
 agx::Object is a refcounted object with a name. More...
 

Namespaces

namespace  agx
 The agx namespace contains the dynamics/math part of the AGX Dynamics API.
 
namespace  agxData
 Contains classes for low level data storage for AGX.
 

Macros

#define AGX_BUILTIN_MODEL(_class, _path, _parent)
 
#define AGX_MODEL_IMPLEMENTATION(_class, _path)
 

Typedefs

typedef agx::observer_ptr< const Object > agx::ObjectConstObserver
 
typedef agx::ref_ptr< const Object > agx::ObjectConstRef
 
typedef agx::observer_ptr< Object > agx::ObjectObserver
 
typedef agx::Vector< ObjectObserver > agx::ObjectObserverVector
 
typedef HashTable< Name, Object * > agx::ObjectPtrTable
 
typedef agx::VectorPOD< Object * > agx::ObjectPtrVector
 
typedef agx::ref_ptr< Object > agx::ObjectRef
 
typedef agx::Vector< ObjectRef > agx::ObjectRefVector
 
using agx::ReentrantMutex = std::recursive_mutex
 

Functions

 agx::AGX_DECLARE_HASHSET_TYPES (Object)
 
AGXCORE_EXPORT void agx::createBuiltinModel (const char *path, Model *parent, std::atomic< Model * > &result)
 
AGXCORE_EXPORT void agx::createImplementedModel (const char *path, std::atomic< Model * > &result)
 
AGXCORE_EXPORT Model * agx::getModel (const char *path, const Path &_namespace=Path())
 
AGXCORE_EXPORT Model * agx::getModel (const Path &path, const Name &implementation, const Path &_namespace=Path())
 
template<typename T >
T * agx::getModel (const Path &path, const Name &implementation, const Path &_namespace=Path())
 
AGXCORE_EXPORT Model * agx::getModel (const Path &path, const Path &_namespace=Path())
 
template<typename T >
T * agx::getModel (const Path &path, const Path &_namespace=Path())
 
AGXCORE_EXPORT Model * agx::getModel (const String &path, const Path &_namespace=Path())
 
AGXCORE_EXPORT Model * agx::getModel (TiXmlElement *element)
 
AGXCORE_EXPORT agx::ReentrantMutex & agx::getTypeSystemMutex ()
 
AGXCORE_EXPORT void agx::printNode (const char *path)
 Debugging.
 
AGXCORE_EXPORT Component * agx::root ()
 

Macro Definition Documentation

◆ AGX_BUILTIN_MODEL

#define AGX_BUILTIN_MODEL (   _class,
  _path,
  _parent 
)
Value:
agx::Model *_class::ClassModel() \
{ \
static std::atomic<agx::Model*> s_model = nullptr; \
\
agx::Model* tmp = s_model.load(std::memory_order_acquire); \
\
if (tmp) \
return tmp; \
\
ScopeLock<ReentrantMutex> lock(agx::getTypeSystemMutex()); \
tmp = s_model.load(std::memory_order_relaxed); \
if (!tmp) { \
agx::createBuiltinModel(_path, _parent, s_model); \
tmp = s_model.load(std::memory_order_relaxed); \
} \
\
return tmp; \
}
static Component * load(const String &path, const Path &_namespace=Path())
A model is an abstract representation of the class of an agx::Object.
Definition: Model.h:41
AGXCORE_EXPORT agx::ReentrantMutex & getTypeSystemMutex()

Definition at line 353 of file Object.h.

◆ AGX_MODEL_IMPLEMENTATION

#define AGX_MODEL_IMPLEMENTATION (   _class,
  _path 
)
Value:
agx::Model *_class::ClassModel() \
{ \
static std::atomic<agx::Model*> s_model = nullptr; \
\
agx::Model* tmp = s_model.load(std::memory_order_acquire); \
\
if (tmp) \
return tmp; \
\
ScopeLock<ReentrantMutex> lock(agx::getTypeSystemMutex()); \
tmp = s_model.load(std::memory_order_relaxed); \
if (!tmp) { \
agx::createImplementedModel(_path, s_model); \
tmp = s_model.load(std::memory_order_relaxed); \
} \
\
if (!tmp) \
LOGGER_ERROR() << agx::String::format("No model found for path \'%s\'. Make sure AGX environment is properly setup", _path) << LOGGER_ENDL(); \
return tmp; \
}
#define LOGGER_ENDL()
Definition: Logger.h:27
static AgXString format(const char *format,...)
C printf formatting of a string.
Definition: String.h:471

Definition at line 330 of file Object.h.