21#ifndef GENERATED_AGX_REFERENCED_H_PLUGIN
22#define GENERATED_AGX_REFERENCED_H_PLUGIN
24#define AGX_ENTITY_WRAPPER 1
30# pragma warning( disable : 4505 )
32# pragma warning( disable : 4251 )
34# pragma warning( disable : 4355 )
36# pragma warning( disable: 4714 )
54 class ReferencedModel;
57 class ReferencedInstance;
58 class ReferencedSemantics;
95 virtual void configure(agx::TiXmlElement* eEntity)
override;
103 #ifndef AGX_REFERENCED_DATA_SET_OVERRIDE
104 #define AGX_REFERENCED_DATA_SET
108 ReferencedInstance operator[] (
size_t index);
126 virtual ~ReferencedData() {}
127 virtual void setNumElements(
agx::Index numElements)
override;
130 ReferencedData& operator= (
const ReferencedData&) {
return *
this; }
156 friend class ReferencedPtr;
157 friend class ReferencedInstance;
158 ReferencedSemantics();
215 ReferencedInstance();
216 ReferencedInstance(ReferencedData* data,
agx::Index index);
221 ReferencedData* getData();
222 const ReferencedData* getData()
const;
254 inline ReferencedInstance
agx::ReferencedData::operator[] (
size_t index) {
return ReferencedInstance(
this, (
agx::Index)index); }
261 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
268 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
276 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
277 EntityPtr::getModel()->fullPath().c_str(), ReferencedModel::instance()->fullPath().c_str());
285 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
286 EntityPtr::getModel()->fullPath().c_str(), ReferencedModel::instance()->fullPath().c_str());
292 AGX_FORCE_INLINE ReferencedSemantics* ReferencedPtr::operator->() {
return (ReferencedSemantics* )
this; }
293 AGX_FORCE_INLINE const ReferencedSemantics* ReferencedPtr::operator->()
const {
return (
const ReferencedSemantics* )
this; }
297 AGX_FORCE_INLINE agx::UInt32& ReferencedPtr::referenceCount() { verifyIndex();
return getData()->referenceCount[calculateIndex()]; }
298 AGX_FORCE_INLINE agx::UInt32 const& ReferencedPtr::referenceCount()
const { verifyIndex();
return getData()->referenceCount[calculateIndex()]; }
313 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
320 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
328 AGX_FORCE_INLINE agx::UInt32& ReferencedInstance::referenceCount() { verifyIndex();
return getData()->referenceCount[getIndex()]; }
329 AGX_FORCE_INLINE agx::UInt32 const& ReferencedInstance::referenceCount()
const { verifyIndex();
return getData()->referenceCount[getIndex()]; }
350#undef AGX_ENTITY_WRAPPER
351#undef AGX_ENTITY_NAMESPACE
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGX_TYPE_BINDING(_Type, _Name)
Type-specific Array used for fast access into the data held by a Buffer.
Entity instance provides access to a single instance in an EntityStorage.
bool isInstanceOf(agxData::EntityModel *model) const
agxData::EntityData * getData()
An abstract description of a data entity stored using SOA (structure of arrays) pattern in a EntitySt...
Accessor to a entity instance stored in a EntityStorage, to allow SOA (structure of arrays) data to b...
EntityPtr & operator=(const EntityPtr &other)=default
bool isInstanceOf(agxData::EntityModel *model) const
agxData::EntityData * getData()
agxData::EntityInstance instance()
An entity reference is a safe/referencing handle to an entity instance whose model is descendant from...
Data storage for a collection of entity instances of a specified EntityModel.
agx::String fullPath() const
Abstract description of the data attributes for the Referenced entity.
static agxData::EntityStorage * defaultStorage()
static agxData::ScalarAttributeT< agx::UInt32 > * referenceCountAttribute
virtual void configure(agx::TiXmlElement *eEntity) override
virtual ~ReferencedModel()
virtual void construct(agxData::EntityPtr instance) override
virtual void initAttributeAccessors() override
ReferencedModel(const agx::String &name="Referenced")
virtual agxData::EntityData * createData(agxData::EntityStorage *storage) override
static agxData::ScalarAttributeT< agx::SpinMutex > * observerMutexAttribute
static ReferencedPtr createInstance()
Create and return a pointer to a new instance in the default storage for this entity model.
static ReferencedModel * instance()
virtual void shutdownCleanup() override
This is part of internal cleanup and should not be called by users.
static agxData::ScalarAttributeT< agx::Vector< agxData::EntityPtr * > > * observersAttribute
void construct(agx::ReferencedPtr referenced)
Pointer to a entity instance of type Referenced.
AGXCORE_EXPORT ReferencedPtr()
ReferencedInstance InstanceType
AGXCORE_EXPORT agx::SpinMutex const & observerMutex() const
AGXCORE_EXPORT ReferencedInstance instance()
AGXCORE_EXPORT agx::UInt32 const & referenceCount() const
AGXCORE_EXPORT const ReferencedSemantics * operator->() const
const ReferencedData * getData() const
AGXCORE_EXPORT agx::UInt32 & referenceCount()
AGXCORE_EXPORT ReferencedPtr(agxData::EntityStorage *storage, agx::Index id)
AGXCORE_EXPORT const ReferencedInstance instance() const
ReferencedData * getData()
AGXCORE_EXPORT ReferencedPtr(const agxData::EntityPtr &ptr)
ReferencedModel ModelType
AGXCORE_EXPORT agx::Vector< agxData::EntityPtr * > const & observers() const
AGXCORE_EXPORT agx::SpinMutex & observerMutex()
AGXCORE_EXPORT ReferencedSemantics * operator->()
AGXCORE_EXPORT ReferencedPtr(const agxData::EntityInstance &instance)
AGXCORE_EXPORT agx::Vector< agxData::EntityPtr * > & observers()
Vector containing 'raw' data.
#define agxAssertN(expr, format,...)
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
Contains classes for low level data storage for AGX.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
agxData::EntityRef< ReferencedPtr > ReferencedRef