17#ifndef AGXDATA_ENTITY_MODEL_H
18#define AGXDATA_ENTITY_MODEL_H
32#define AGX_ENTITY_NAMESPACE ""
38 class EntityParameter;
81 static bool getThreadSafe();
118 bool hasConstructor()
const;
135 void print(std::ostream& stream)
const;
148 template <
typename T>
181 const SharedBufferVector& getSharedBuffers()
const;
182 const SharedStorageVector& getSharedStorages()
const;
184 void addSharedBuffer(SharedBuffer buffer);
185 void addSharedStorage(SharedStorage storage);
188 static void initDefaultEntity();
190 static bool s_threadSafe;
193 EntityModelPtrVector m_children;
194 AttributePtrVector m_attributes;
195 SharedBufferVector m_sharedBuffers;
196 SharedStorageVector m_sharedStorages;
197 EntityStorage *m_defaultStorage;
198 bool m_useInstanceTable;
199 bool m_hasConstructor;
211 template <
typename T>
229 AGX_FORCE_INLINE const EntityModel::SharedStorageVector& EntityModel::getSharedStorages()
const {
return m_sharedStorages; }
242#undef AGX_ENTITY_NAMESPACE
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGX_TYPE_BINDING(_Type, _Name)
An abstract attribute description, part of an Entity.
virtual EntityModel * load()
LoaderT(const char *modelPath)
An abstract description of a data entity stored using SOA (structure of arrays) pattern in a EntitySt...
size_t getNumBytes(agx::Device *device)
static agx::Model * ClassModel()
void setHasConstructor(bool flag)
static bool getThreadSafe()
virtual void initAttributeAccessors()
static EntityModel * getRootModel()
bool hasConstructor() const
void setUseInstanceTable(bool flag)
Attribute * getAttribute(const agx::Name &name)
virtual void construct(agxData::EntityPtr)
static agx::Namespace * root()
void addChild(EntityModel *child)
const Attribute * getAttribute(const agx::Name &name) const
Loader(const char *modelPath)
const AttributePtrVector & getAttributes() const
virtual void shutdownCleanup()
void addAttribute(Attribute *attribute)
Add an attribute to the entity.
static bool findEntityPath(const agx::Path &entityPath, agx::Path &fullEntityPath, agx::String &filePath, agx::String &classPath, agx::TiXmlElement *relativeRoot=nullptr, agxIO::Environment::Type envType=agxIO::Environment::RUNTIME_PATH)
static ScalarAttributeT< EntityPtr > * instanceAttribute
void propagateNewAttribute(Attribute *attribute)
void removeChild(EntityModel *child)
EntityPtr createInstanceWrapper()
agx::Event1< EntityStorage * > StorageEvent
void setBaseEntity(EntityModel *base)
void print(std::ostream &stream) const
Print the registered attributes.
static EntityModel * load(agx::TiXmlElement *eEntity, agx::Device *device)
EntityStorage * getDefaultStorage()
virtual EntityModel * load()=0
EntityModel * getSource()
virtual EntityData * createData(EntityStorage *storage)
static void setThreadSafe(bool flag)
EntityModel(const agx::Name &name)
StorageEvent storageCreationEvent
bool useInstanceTable() const
virtual void configure(agx::TiXmlElement *eEntity)
Accessor to a entity instance stored in a EntityStorage, to allow SOA (structure of arrays) data to b...
Data storage for a collection of entity instances of a specified EntityModel.
Type
Specifies which path to access.
@ RUNTIME_PATH
Specifies paths for where to search for plugin's/runtime libraries.
An agx::Device is an abstract representation of a device on which data can be stored and processed.
An event with one argument.
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.
A namespace is used as a group node in the agx::Model hierarchy.
Representation of a path, a list of name components.
Contains classes for low level data storage for AGX.
AGXCORE_EXPORT bool hasEntity(const agx::Path &path)
agx::Vector< Attribute * > AttributePtrVector
agx::HashTable< Attribute *, EntityModel * > EntityDependencyTable
agx::Vector< EntityModel * > EntityModelPtrVector
AGXCORE_EXPORT EntityModel * getEntity(const agx::Path &path)
Get a entity with a specified path.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.