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;
83 virtual void shutdownCleanup()
override;
95 virtual void configure(agx::TiXmlElement* eEntity)
override;
96 virtual void initAttributeAccessors()
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; }
138 class
AGXCORE_EXPORT ReferencedSemantics : protected agxData::EntityPtr
156 friend class ReferencedPtr;
157 friend class ReferencedInstance;
158 ReferencedSemantics();
186 ReferencedData* getData();
187 const ReferencedData* getData()
const;
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); }
226 class
AGXCORE_EXPORT ReferencedInstance : public agxData::EntityInstance
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()]; }
322 AGX_FORCE_INLINE ReferencedInstance::ReferencedInstance(ReferencedData* data,
agx::Index index) : agxData::EntityInstance(data, index) {}
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
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.
#define agxAssertN(expr, format,...)
agxData::EntityData * getData()
#define AGX_TYPE_BINDING(_Type, _Name)
AGXCORE_EXPORT Model * getModel(const Path &path, const Path &_namespace=Path())
bool isInstanceOf(agxData::EntityModel *model) const
static agxData::ScalarAttributeT< agx::Vector< agxData::EntityPtr * > > * observersAttribute
Entity instance provides access to a single instance in an EntityStorage.
Accessor to a entity instance stored in a EntityStorage, to allow SOA (structure of arrays) data to b...
#define AGX_DECLARE_POINTER_TYPES(type)
agx::String fullPath() const
static agxData::ScalarAttributeT< agx::SpinMutex > * observerMutexAttribute
ReferencedModel ModelType
Type-specific Array used for fast access into the data held by a Buffer.
Vector containing 'raw' data.
EntityPtr & operator=(const EntityPtr &other)=default
AGXCORE_EXPORT ReferencedPtr()
static ReferencedModel * instance()
static agxData::ScalarAttributeT< agx::UInt32 > * referenceCountAttribute
An abstract description of a data entity stored using SOA (structure of arrays) pattern in a EntitySt...
Abstract description of the data attributes for the Referenced entity.
bool isInstanceOf(agxData::EntityModel *model) const
Pointer to a entity instance of type Referenced.
ReferencedInstance InstanceType
#define DOXYGEN_END_INTERNAL_BLOCK()
agxData::EntityRef< ReferencedPtr > ReferencedRef
#define DOXYGEN_START_INTERNAL_BLOCK()