|
AGX Dynamics 2.41.3.0
|
Accessor to a entity instance stored in a EntityStorage, to allow SOA (structure of arrays) data to be accessed using a AOS (array of structures) pattern. More...
#include <EntityPtr.h>
Inheritance diagram for agxData::EntityPtr:Public Member Functions | |
| EntityPtr () | |
| EntityPtr (agxData::EntityStorage *storage, agx::Index id) | |
| EntityPtr (const agxData::EntityInstance &instance) | |
| EntityPtr (const agxData::EntityPtr &other)=default | |
| ~EntityPtr ()=default | |
| agx::Index | calculateIndex () const |
| Calculate the index using the indirect id. | |
| agxData::EntityPtr | copy () |
| Create a copy instance in the same storage. | |
| agxData::EntityPtr | copy (agxData::EntityStorage *target) |
| Copy instance to another storage. | |
| void | copyAttributes (agxData::EntityPtr source) |
| Copy instance attributes to an existing target instance. | |
| template<typename T > | |
| T & | dataSet () |
| template<typename T > | |
| const T & | dataSet () const |
| void | destroy () |
| Remove the entity from the active storage. | |
| agxData::EntityData * | getData () |
| const agxData::EntityData * | getData () const |
| agx::Index | getId () const |
| agxData::EntityModel * | getModel () |
| const agxData::EntityModel * | getModel () const |
| agxData::EntityStorage * | getStorage () const |
| agx::UInt32 | hash () const |
| void | init (agxData::EntityStorage *storage, agx::Index id) |
| Set the target storage and id. | |
| agxData::EntityInstance | instance () |
| const agxData::EntityInstance | instance () const |
| void | invalidate () |
| Invalidate the entity pointer. | |
| bool | isInstanceOf (agxData::EntityModel *model) const |
| bool | isValid () const |
| operator bool () const | |
| bool | operator! () const |
| bool | operator!= (const EntityPtr &rhs) const |
| template<typename T > | |
| agxData::ArrayAttributeT< T >::Type & | operator() (const agxData::ArrayAttributeT< T > *attribute) |
| Array attribute. | |
| template<typename T > | |
| const agxData::ArrayAttributeT< T >::Type & | operator() (const agxData::ArrayAttributeT< T > *attribute) const |
| template<typename T > | |
| agxData::HashSetAttributeT< T >::Type & | operator() (const agxData::HashSetAttributeT< T > *attribute) |
| HashSet attribute. | |
| template<typename T > | |
| const agxData::HashSetAttributeT< T >::Type & | operator() (const agxData::HashSetAttributeT< T > *attribute) const |
| template<typename T > | |
| T & | operator() (const agxData::PointerAttributeT< T > *attribute) |
| Pointer attribute. | |
| template<typename T > | |
| const T & | operator() (const agxData::PointerAttributeT< T > *attribute) const |
| template<typename T > | |
| T & | operator() (const agxData::ScalarAttributeT< T > *attribute) |
| Access the value of a specific attribute. | |
| template<typename T > | |
| const T & | operator() (const agxData::ScalarAttributeT< T > *attribute) const |
| template<typename T > | |
| T & | operator() (const agxData::SharedAttributeT< T > *attribute) |
| Shared attribute. | |
| template<typename T > | |
| const T & | operator() (const agxData::SharedAttributeT< T > *attribute) const |
| template<typename T > | |
| agxData::VectorAttributeT< T >::Type & | operator() (const agxData::VectorAttributeT< T > *attribute) |
| Vector attribute. | |
| template<typename T > | |
| const agxData::VectorAttributeT< T >::Type & | operator() (const agxData::VectorAttributeT< T > *attribute) const |
| template<typename T > | |
| ArrayAttributeT< T >::Type & | operator() (const ArrayAttributeT< T > *attribute) |
| template<typename T > | |
| const ArrayAttributeT< T >::Type & | operator() (const ArrayAttributeT< T > *attribute) const |
| template<typename T > | |
| HashSetAttributeT< T >::Type & | operator() (const HashSetAttributeT< T > *attribute) |
| template<typename T > | |
| const HashSetAttributeT< T >::Type & | operator() (const HashSetAttributeT< T > *attribute) const |
| template<typename T > | |
| VectorAttributeT< T >::Type & | operator() (const VectorAttributeT< T > *attribute) |
| template<typename T > | |
| const VectorAttributeT< T >::Type & | operator() (const VectorAttributeT< T > *attribute) const |
| bool | operator< (const EntityPtr &rhs) const |
| EntityPtr & | operator= (const EntityPtr &other)=default |
| EntityPtr & | operator= (EntityPtr &&)=default |
| bool | operator== (const EntityPtr &rhs) const |
| bool | operator> (const EntityPtr &rhs) const |
| void | print () const |
| void | print (std::ostream &stream) const |
| void | swapId (EntityPtr &other) |
| Swap id with another instance. | |
| void | swapIndex (EntityPtr &other) |
| Swap index with another instance. | |
| void | transfer (agxData::EntityStorage *target) |
| Transfer instance to another storage. | |
| void | verifyIndex () const |
| Check for broken ptr, by verifying that the id is active in the storage. | |
Static Public Member Functions | |
| static EntityPtr | createWithIndex (EntityStorage *storage, agx::Index index) |
| static void | TransformToAscii (void *targetBuffer, const void *sourceBuffer, size_t numElements) |
Accessor to a entity instance stored in a EntityStorage, to allow SOA (structure of arrays) data to be accessed using a AOS (array of structures) pattern.
The entity pointer has a indirect id to its data inside the storage. The actual array index where the data is stored may change as the storage is reordered, but the EntityPtr is valid as long as the instance is not destroyed or transferred to another storage.
Definition at line 51 of file EntityPtr.h.
| agxData::EntityPtr::EntityPtr | ( | ) |
Definition at line 264 of file EntityPtr.h.
Referenced by createWithIndex().
| agxData::EntityPtr::EntityPtr | ( | agxData::EntityStorage * | storage, |
| agx::Index | id | ||
| ) |
Definition at line 265 of file EntityPtr.h.
References init().
|
default |
| agxData::EntityPtr::EntityPtr | ( | const agxData::EntityInstance & | instance | ) |
Definition at line 796 of file EntityStorage.h.
References agxData::EntityInstance::getIndex(), agxData::EntityStorage::indexToId(), and instance().
|
default |
| agx::Index agxData::EntityPtr::calculateIndex | ( | ) | const |
Calculate the index using the indirect id.
Definition at line 613 of file EntityStorage.h.
References agxAssert1, and agxData::EntityStorage::idToIndex().
Referenced by agxData::EntityInstance::EntityInstance(), agxData::EntityStorage::dereferenceMultipliedAttribute(), instance(), swapIndex(), and verifyIndex().
| agxData::EntityPtr agxData::EntityPtr::copy | ( | ) |
Create a copy instance in the same storage.
| agxData::EntityPtr agxData::EntityPtr::copy | ( | agxData::EntityStorage * | target | ) |
Copy instance to another storage.
| void agxData::EntityPtr::copyAttributes | ( | agxData::EntityPtr | source | ) |
Copy instance attributes to an existing target instance.
|
inlinestatic |
Definition at line 790 of file EntityStorage.h.
References EntityPtr(), agxAssert, and agxData::EntityStorage::indexToId().
Referenced by agx::createCell().
| T & agxData::EntityPtr::dataSet |
Definition at line 603 of file EntityStorage.h.
| const T & agxData::EntityPtr::dataSet |
Definition at line 610 of file EntityStorage.h.
| void agxData::EntityPtr::destroy | ( | ) |
Remove the entity from the active storage.
| EntityData * agxData::EntityPtr::getData | ( | ) |
Definition at line 594 of file EntityStorage.h.
References agxAssert, and agxData::EntityStorage::getData().
Referenced by agxData::EntityInstance::EntityInstance(), dataSet(), getData(), and instance().
| const EntityData * agxData::EntityPtr::getData | ( | ) | const |
Definition at line 600 of file EntityStorage.h.
References getData().
| agx::Index agxData::EntityPtr::getId | ( | ) | const |
Definition at line 273 of file EntityPtr.h.
Referenced by agxCollide::CollisionGroupManager::canSetsCollide(), agxData::EntityStorage::dereferenceMultipliedAttribute(), agxData::EntityStorage::destroyInstance(), operator!=(), operator<(), operator==(), and operator>().
| EntityModel * agxData::EntityPtr::getModel | ( | ) |
Definition at line 757 of file EntityStorage.h.
References agxData::EntityStorage::getEntityModel().
| const EntityModel * agxData::EntityPtr::getModel | ( | ) | const |
Definition at line 762 of file EntityStorage.h.
References agxData::EntityStorage::getEntityModel().
| EntityStorage * agxData::EntityPtr::getStorage | ( | ) | const |
Definition at line 272 of file EntityPtr.h.
Referenced by agxCollide::CollisionGroupManager::canSetsCollide(), agxData::EntityStorage::dereferenceMultipliedAttribute(), operator!=(), and operator==().
| agx::UInt32 agxData::EntityPtr::hash | ( | ) | const |
Definition at line 281 of file EntityPtr.h.
References agx::hash().
| void agxData::EntityPtr::init | ( | agxData::EntityStorage * | storage, |
| agx::Index | id | ||
| ) |
Set the target storage and id.
Definition at line 588 of file EntityStorage.h.
Referenced by EntityPtr().
|
inline |
Definition at line 269 of file EntityPtr.h.
References calculateIndex(), and getData().
Referenced by EntityPtr().
|
inline |
Definition at line 270 of file EntityPtr.h.
References calculateIndex(), and getData().
| void agxData::EntityPtr::invalidate | ( | ) |
Invalidate the entity pointer.
Definition at line 275 of file EntityPtr.h.
References agx::InvalidIndex.
| bool agxData::EntityPtr::isInstanceOf | ( | agxData::EntityModel * | model | ) | const |
Definition at line 784 of file EntityStorage.h.
References agxData::EntityStorage::getEntityModel(), and agx::Model::is().
| bool agxData::EntityPtr::isValid | ( | ) | const |
Definition at line 287 of file EntityPtr.h.
Referenced by operator!().
| agxData::EntityPtr::operator bool | ( | ) | const |
Definition at line 289 of file EntityPtr.h.
| bool agxData::EntityPtr::operator! | ( | ) | const |
Definition at line 288 of file EntityPtr.h.
References isValid().
| bool agxData::EntityPtr::operator!= | ( | const EntityPtr & | rhs | ) | const |
Definition at line 306 of file EntityPtr.h.
References getId(), and getStorage().
| agxData::ArrayAttributeT< T >::Type & agxData::EntityPtr::operator() | ( | const agxData::ArrayAttributeT< T > * | attribute | ) |
Array attribute.
| const agxData::ArrayAttributeT< T >::Type & agxData::EntityPtr::operator() | ( | const agxData::ArrayAttributeT< T > * | attribute | ) | const |
| agxData::HashSetAttributeT< T >::Type & agxData::EntityPtr::operator() | ( | const agxData::HashSetAttributeT< T > * | attribute | ) |
HashSet attribute.
| const agxData::HashSetAttributeT< T >::Type & agxData::EntityPtr::operator() | ( | const agxData::HashSetAttributeT< T > * | attribute | ) | const |
| T & agxData::EntityPtr::operator() | ( | const agxData::PointerAttributeT< T > * | attribute | ) |
Pointer attribute.
Definition at line 653 of file EntityStorage.h.
| const T & agxData::EntityPtr::operator() | ( | const agxData::PointerAttributeT< T > * | attribute | ) | const |
Definition at line 659 of file EntityStorage.h.
| T & agxData::EntityPtr::operator() | ( | const agxData::ScalarAttributeT< T > * | attribute | ) |
Access the value of a specific attribute.
Definition at line 641 of file EntityStorage.h.
| const T & agxData::EntityPtr::operator() | ( | const agxData::ScalarAttributeT< T > * | attribute | ) | const |
Definition at line 647 of file EntityStorage.h.
| T & agxData::EntityPtr::operator() | ( | const agxData::SharedAttributeT< T > * | attribute | ) |
Shared attribute.
Definition at line 743 of file EntityStorage.h.
References agxAssert, agxData::Value::get(), agx::Object::getName(), and agx::Component::getObject().
| const T & agxData::EntityPtr::operator() | ( | const agxData::SharedAttributeT< T > * | attribute | ) | const |
Definition at line 751 of file EntityStorage.h.
| agxData::VectorAttributeT< T >::Type & agxData::EntityPtr::operator() | ( | const agxData::VectorAttributeT< T > * | attribute | ) |
Vector attribute.
| const agxData::VectorAttributeT< T >::Type & agxData::EntityPtr::operator() | ( | const agxData::VectorAttributeT< T > * | attribute | ) | const |
| ArrayAttributeT< T >::Type & agxData::EntityPtr::operator() | ( | const ArrayAttributeT< T > * | attribute | ) |
Definition at line 666 of file EntityStorage.h.
| const ArrayAttributeT< T >::Type & agxData::EntityPtr::operator() | ( | const ArrayAttributeT< T > * | attribute | ) | const |
Definition at line 672 of file EntityStorage.h.
| HashSetAttributeT< T >::Type & agxData::EntityPtr::operator() | ( | const HashSetAttributeT< T > * | attribute | ) |
Definition at line 692 of file EntityStorage.h.
| const HashSetAttributeT< T >::Type & agxData::EntityPtr::operator() | ( | const HashSetAttributeT< T > * | attribute | ) | const |
Definition at line 698 of file EntityStorage.h.
| VectorAttributeT< T >::Type & agxData::EntityPtr::operator() | ( | const VectorAttributeT< T > * | attribute | ) |
Definition at line 680 of file EntityStorage.h.
| const VectorAttributeT< T >::Type & agxData::EntityPtr::operator() | ( | const VectorAttributeT< T > * | attribute | ) | const |
Definition at line 686 of file EntityStorage.h.
| bool agxData::EntityPtr::operator< | ( | const EntityPtr & | rhs | ) | const |
Definition at line 291 of file EntityPtr.h.
References getId().
| bool agxData::EntityPtr::operator== | ( | const EntityPtr & | rhs | ) | const |
Definition at line 301 of file EntityPtr.h.
References getId(), and getStorage().
| bool agxData::EntityPtr::operator> | ( | const EntityPtr & | rhs | ) | const |
Definition at line 296 of file EntityPtr.h.
References getId().
| void agxData::EntityPtr::print | ( | ) | const |
| void agxData::EntityPtr::print | ( | std::ostream & | stream | ) | const |
| void agxData::EntityPtr::swapId | ( | EntityPtr & | other | ) |
Swap id with another instance.
Both must be part of the same storage.
Definition at line 767 of file EntityStorage.h.
References agxAssert.
| void agxData::EntityPtr::swapIndex | ( | EntityPtr & | other | ) |
Swap index with another instance.
Both must be part of the same storage.
Definition at line 775 of file EntityStorage.h.
References agxAssert, calculateIndex(), and agxData::EntityStorage::swapInstances().
| void agxData::EntityPtr::transfer | ( | agxData::EntityStorage * | target | ) |
Transfer instance to another storage.
|
static |
| void agxData::EntityPtr::verifyIndex | ( | ) | const |
Check for broken ptr, by verifying that the id is active in the storage.
Only used in debug mode.
Definition at line 631 of file EntityStorage.h.
References agxAssertN, agx::Path::c_str(), calculateIndex(), and agx::Object::getPath().