21 #ifndef GENERATED_AGX_REFERENCED_H_PLUGIN
22 #define GENERATED_AGX_REFERENCED_H_PLUGIN
24 #define AGX_ENTITY_WRAPPER 1
28 # pragma warning(push)
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();
207 #ifdef AGX_GENERATED_TOLUA_WRAPPER
208 inline agx::UInt32 const& getReferenceCount()
const {
return (*this)->getReferenceCount(); }
209 inline agx::SpinMutex const& getObserverMutex()
const {
return (*this)->getObserverMutex(); }
213 inline void setReferenceCount(
agx::UInt32 const& value) { (*this)->setReferenceCount(value); }
214 inline void setObserverMutex(
agx::SpinMutex const& value) { (*this)->setObserverMutex(value); }
229 ReferencedInstance();
230 ReferencedInstance(ReferencedData* data,
agx::Index index);
235 ReferencedData* getData();
236 const ReferencedData* getData()
const;
268 inline ReferencedInstance
agx::ReferencedData::operator[] (
size_t index) {
return ReferencedInstance(
this, (
agx::Index)index); }
275 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
282 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
290 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
299 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
306 AGX_FORCE_INLINE ReferencedSemantics* ReferencedPtr::operator->() {
return (ReferencedSemantics* )
this; }
307 AGX_FORCE_INLINE const ReferencedSemantics* ReferencedPtr::operator->()
const {
return (
const ReferencedSemantics* )
this; }
311 AGX_FORCE_INLINE agx::UInt32& ReferencedPtr::referenceCount() { verifyIndex();
return getData()->referenceCount[calculateIndex()]; }
312 AGX_FORCE_INLINE agx::UInt32 const& ReferencedPtr::referenceCount()
const { verifyIndex();
return getData()->referenceCount[calculateIndex()]; }
327 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
334 "Entity type mismatch. Storage contains entity data for type \'%s\', instance pointer is of type \'%s\'",
342 AGX_FORCE_INLINE agx::UInt32& ReferencedInstance::referenceCount() { verifyIndex();
return getData()->referenceCount[getIndex()]; }
343 AGX_FORCE_INLINE agx::UInt32 const& ReferencedInstance::referenceCount()
const { verifyIndex();
return getData()->referenceCount[getIndex()]; }
361 # pragma warning(pop)
364 #undef AGX_ENTITY_WRAPPER
365 #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...
bool isInstanceOf(agxData::EntityModel *model) const
agxData::EntityData * getData()
agxData::EntityInstance instance()
EntityPtr & operator=(const EntityPtr &other)=default
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 ReferencedModel * instance()
static agxData::ScalarAttributeT< agx::UInt32 > * referenceCountAttribute
virtual void configure(agx::TiXmlElement *eEntity) override
virtual ~ReferencedModel()
virtual void construct(agxData::EntityPtr instance) override
virtual agxData::EntityData * createData(agxData::EntityStorage *storage) override
virtual void initAttributeAccessors() override
ReferencedModel(const agx::String &name="Referenced")
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.
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()
AGXCORE_EXPORT agx::Vector< agxData::EntityPtr * > const & observers() const
ReferencedInstance InstanceType
AGXCORE_EXPORT agx::SpinMutex const & observerMutex() const
AGXCORE_EXPORT ReferencedInstance instance()
AGXCORE_EXPORT const ReferencedSemantics * operator->() const
AGXCORE_EXPORT agx::SpinMutex & observerMutex()
AGXCORE_EXPORT agx::UInt32 & referenceCount()
AGXCORE_EXPORT ReferencedPtr(agxData::EntityStorage *storage, agx::Index id)
AGXCORE_EXPORT agx::UInt32 const & referenceCount() const
AGXCORE_EXPORT ReferencedSemantics * operator->()
AGXCORE_EXPORT const ReferencedInstance instance() const
ReferencedData * getData()
AGXCORE_EXPORT ReferencedPtr(const agxData::EntityPtr &ptr)
const ReferencedData * getData() const
ReferencedModel ModelType
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
AGXCORE_EXPORT Model * getModel(const Path &path, const Path &_namespace=Path())