AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agxData::Buffer Class Reference

Abstract representation of a data buffer. More...

#include <Buffer.h>

+ Inheritance diagram for agxData::Buffer:

Public Types

typedef agx::Event1< Buffer * > Event
 
typedef agx::observer_ptr
< const Event > 
EventConstObserver
 
typedef agx::ref_ptr< const Event > EventConstRef
 
typedef agx::observer_ptr< Event > EventObserver
 
typedef agx::ref_ptr< Event > EventRef
 
typedef Event2< Component
*, Object * > 
ObjectEvent
 Event when adding removing child objects. More...
 
typedef agx::Callback2< Buffer
*, const agx::IndexRange & > 
RangeCallback
 Specify a custom element initializer callback. More...
 
typedef Callback1< Object * > TraverseCallback
 

Public Member Functions

 Buffer (const agx::Name &name, const agxData::Format *format)
 
 Buffer (const agxData::Format *format)
 
void addListener (EventListener *listener)
 
virtual void addObject (agx::Object *object, bool assignContext=true)
 Add an object to the component. More...
 
 AGX_DECLARE_VECTOR_TYPES (Event)
 
void * allocateBackBuffer ()
 
template<typename T >
T * as ()
 Subclass casting. More...
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match. More...
 
template<typename T >
const T * asSafe () const
 
virtual String autoComplete (const String &partialName, StringVector &matchingNames) const
 
virtual void buildNavigationTree (agxJson::Value &eNode) const override
 
size_t capacity () const
 
void clear ()
 Clear the buffer. More...
 
Buffer * clone () const
 Clone the buffer. More...
 
Buffer * clone (const agx::IndexRange &range) const
 Clone a subset of the buffer. More...
 
Buffer * clone (const agxData::IndexArray &indices) const
 
Buffer * clone (const agx::IndexVector &indices) const
 
void commit ()
 
void commit (agx::IndexRange32 range)
 
void commit (agx::Index index)
 
void commit (const agxData::IndexArray &indexList)
 
virtual void configure (TiXmlElement *eComponent) override
 
virtual void configure (agx::TiXmlElement *eBuffer) override
 
void configure (Model *model)
 
void deleteOverflowBuffer (void *buffer, size_t numElements)
 
bool empty () const
 
agx::String fullName () const
 
agx::String fullPath () const
 
agx::String fullPath (const agx::Object *root) const
 
template<typename T >
agxData::Array< T > & getArray ()
 Convenience method to get an direct data array. More...
 
template<typename T >
const agxData::Array< T > & getArray () const
 
agxData::AbstractArray & getArray ()
 
const agxData::AbstractArray & getArray () const
 
agxData::Attribute * getAttribute ()
 
const agxData::Attribute * getAttribute () const
 
agx::Object * getAutoScopedResource (const agx::Path &path, agx::Model *model=nullptr)
 
const agx::Object * getAutoScopedResource (const agx::Path &path, agx::Model *model=nullptr) const
 
template<typename T >
T * getAutoScopedResource (const agx::Path &path)
 
template<typename T >
const T * getAutoScopedResource (const agx::Path &path) const
 
agx::Object * getContext ()
 
const agx::Object * getContext () const
 
template<typename T >
T * getContext ()
 
template<typename T >
const T * getContext () const
 
agxData::Value * getDefaultValue ()
 
const agxData::Value * getDefaultValue () const
 
agx::Device * getDevice ()
 
const agx::Device * getDevice () const
 
template<typename T >
T * getDevice ()
 
template<typename T >
const T * getDevice () const
 
template<typename T >
T & getElement (size_t index)
 
template<typename T >
const T & getElement (size_t index) const
 
void * getElement (size_t index)
 
const void * getElement (size_t index) const
 
size_t getElementArraySize () const
 
Buffer * getElementBuffer ()
 If the buffer contains arrays/vectors, the actual elements are stored in another buffer. More...
 
const Buffer * getElementBuffer () const
 
agxData::Format * getFormat ()
 
const agxData::Format * getFormat () const
 
Buffer * getGlobalOrderBuffer ()
 If the buffer is used as a global result, we provide a permutation buffer for parallel determinism. More...
 
const Buffer * getGlobalOrderBuffer () const
 
agx::GlobalResultBuffer * getGlobalResult ()
 
const agx::GlobalResultBuffer * getGlobalResult () const
 
agx::UInt32 getId () const
 
const agx::Name & getImplementationName () const
 
agx::Model * getModel ()
 
const agx::Model * getModel () const
 
const agx::Name & getName () const
 
agx::Object * getNextSibling ()
 
const agx::Object * getNextSibling () const
 
size_t getNumObjects (const agx::Name &name) const
 
agx::Object * getObject (const agx::Name &name, size_t index=0)
 
const agx::Object * getObject (const agx::Name &name, size_t index=0) const
 
agx::Object * getObject (const agx::Name &name, agx::Model *model, size_t index=0)
 
const agx::Object * getObject (const agx::Name &name, agx::Model *model, size_t index=0) const
 
template<typename T >
T * getObject (const agx::Name &name, size_t index=0)
 
template<typename T >
const T * getObject (const agx::Name &name, size_t index=0) const
 
const agx::ObjectRefVector & getObjects () const
 
template<typename T >
void getObjects (agx::ObjectPtrVector &result, bool recursive=false) const
 
void getObjects (agx::ObjectPtrVector &result, const agx::Model *model, bool recursive=false) const
 
template<typename T >
void getObjects (ObjectPtrVector &result, bool recursive) const
 
Buffer * getOrCreateGlobalOrderBuffer ()
 
Buffer * getOriginalBuffer ()
 
const Buffer * getOriginalBuffer () const
 
agx::Path getPath () const
 
agx::Path getPath (const agx::Object *root) const
 
int getReferenceCount () const
 
const
agxData::Value::Event::CallbackType & 
getReserveCallback () const
 
const
agxData::Value::Event::CallbackType & 
getResizeCallback () const
 
agx::Object * getResource (const agx::Path &path, agx::Model *model=nullptr)
 
const agx::Object * getResource (const agx::Path &path, agx::Model *model=nullptr) const
 
template<typename T >
T * getResource (const agx::Path &path)
 
template<typename T >
const T * getResource (const agx::Path &path) const
 
virtual Object * getResourceImpl (const Path &path, agx::Model *model) override
 
agx::UInt64 getRevision () const
 
agx::Object * getRootContext ()
 
const agx::Object * getRootContext () const
 
agxData::EntityStorage * getStorage ()
 
const agxData::EntityStorage * getStorage () const
 
agxData::Type * getType ()
 
const agxData::Type * getType () const
 
bool hasListener (EventListener *listener)
 
bool hasParent (const agx::Object *node) const
 
void initialize (const agx::IndexRange &range)
 Initialize a range of elements. More...
 
template<typename T >
bool is () const
 Subclass test. More...
 
bool isUnique () const
 
void * kernelOverflowReallocation (size_t size)
 
void presize (size_t size, size_t initialSize)
 
void print () const
 Print the buffer. More...
 
void print (agx::IndexRange range) const
 
void print (std::ostream &stream) const
 
void print (std::ostream &stream, agx::IndexRange range) const
 
virtual void printSubtree () const override
 
void printSubtree (std::ostream &stream, int depth=0) const
 
void * ptr ()
 Get access to the raw data buffer. More...
 
const void * ptr () const
 
template<typename T >
T * ptr ()
 
template<typename T >
const T * ptr () const
 
virtual void rebind () override
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void registerSharedContainer (agx::Container *container)
 
void removeAllObjects ()
 Remove all components. More...
 
void removeListener (EventListener *listener)
 
virtual void removeObject (agx::Object *object)
 Remove an object from the component. More...
 
void removeObject (const agx::Name &name, size_t index=0)
 Remove an object with a specified name (and optional index) from the component. More...
 
void reserve (size_t size)
 Reserve space for future buffer expansion. More...
 
void resize (size_t size, bool initializeElements=true)
 Resize the buffer. More...
 
virtual void save (TiXmlElement *) const
 
virtual void setContext (agx::Object *context)
 
void setDefaultValue (agxData::Value *value)
 Set the default element value. More...
 
void setElementBuffer (Buffer *buffer)
 Set the element buffer, internal use only. More...
 
void setElementDestructor (const RangeCallback &callback)
 
void setElementInitializer (const RangeCallback &callback)
 
void setId (UInt32 id)
 
void setModel (agx::Model *model)
 Set the object model (handled automatically). More...
 
void setName (const agx::Name &name)
 Set the name of the object. More...
 
void setRevision (agx::UInt64 revision)
 
size_t size () const
 
virtual void snapshot (TiXmlNode *eParent, const String &directory) const override
 
virtual void snapshot (agx::TiXmlNode *eParent, const agx::String &directory) const override
 
void swapBackBuffer (void *backBuffer)
 
void traverse (const TraverseCallback &callback)
 
void traverse (ComponentVisitor *)
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unregisterSharedContainer (agx::Container *container)
 

Static Public Member Functions

static Component * _load (TiXmlElement *eComponent, Device *device)
 
static agx::Model * ClassModel ()
 
static void copy (Buffer *target, const Buffer *source)
 Copy one buffer to another. More...
 
static void copy (Buffer *target, size_t targetOffset, const Buffer *source, size_t sourceOffset, size_t numElements)
 
static void copyGather (Buffer *target, const Buffer *source, const agxData::IndexArray &indices)
 
static void copyScatter (Buffer *target, const Buffer *source, const agxData::IndexArray &indices)
 
static agx::String generateName (const agx::String &bindPath)
 
static const HashSet< Object * > & getActiveObjects ()
 
static bool getEnableRebind ()
 Should rebinding be allowed? Right now a global setting. More...
 
static Component * load (const String &path, const Path &_namespace=Path())
 
static Component * load (const String &path, Device *device, const Path &_namespace=Path())
 
static Component * load (const Path &path, const Name &implementation, Device *device, const Path &_namespace=Path())
 
static Component * load (TiXmlElement *eComponent, Device *device)
 
static Buffer * load (agx::TiXmlElement *eBuffer, agx::Device *device)
 
static Object * load (const String &path, Device *device, const String &type="", size_t instance=0)
 
static Object * load (const String &path, Device *device, const String &type, const String &attribute, const String &value)
 
static void load (const String &path, Device *device, ObjectPtrVector &loadedObjects)
 
static TiXmlDocument openDocument (const String &path)
 
static void setEnableRebind (bool flag)
 Sets if rebinding of objects should be allowed (Right now a global setting). More...
 
template<typename T >
static bool ValidateCast (const Referenced *object)
 

Public Attributes

ObjectEvent addObjectEvent
 
agxData::ValueRefT< agx::UInt > capacityParameter
 
Event reallocationEvent
 Triggered when buffer is reallocated. More...
 
ObjectEvent removeObjectEvent
 
agxData::ValueRefT< agx::UInt > sizeParameter
 

Static Public Attributes

static agx::UInt ALIGNMENT
 
static agx::Real CAPACITY_MULTIPLIER
 
static agx::UInt MIN_BUFFER_CAPACITY
 

Protected Member Functions

virtual ~Buffer ()
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
String expandAutoCompletionMatch (const String &query, const StringVector &matchingNames) const
 
virtual void reallocate (size_t size)
 
void setDevice (Device *device)
 

Static Protected Member Functions

static void destroyElements (Buffer *buffer, const agx::IndexRange &range)
 
static DeleteHandler * getDeleteHandler ()
 
static void initializeElements (Buffer *buffer, const agx::IndexRange &range)
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More...
 

Protected Attributes

agx::ByteAllocator m_allocator
 
AbstractArray m_array
 
Attribute * m_attribute
 
size_t m_capacity
 
agxData::ValueRef m_defaultElementValue
 
RangeCallback m_destructor
 
agxData::BufferRef m_elementBuffer
 
EventDispatch m_eventDispatch
 
FormatRef m_format
 
agxData::BufferRef m_globalOrderBuffer
 
agx::GlobalResultBuffer * m_globalResult
 
bool m_initElements
 
RangeCallback m_initializer
 
Mutex m_mutex
 
ObserverContainer m_observers
 
agxData::Buffer * m_originalBuffer
 
void * m_ptr
 
AtomicValue m_refCount
 
agxData::Value::Event::CallbackType m_reserveCallback
 
agxData::Value::Event::CallbackType m_resizeCallback
 
agx::UInt64 m_revision
 
agx::Container * m_sharedContainer
 
agxData::ShareHandleRef m_shareHandle
 
size_t m_size
 
EntityStorage * m_storage
 
bool m_usedResizeMethod
 

Detailed Description

Abstract representation of a data buffer.

The buffer has a name and data format/type. The buffer is an agx::Object and can be inserted in the system hierarchy.

Definition at line 55 of file Buffer.h.

Member Typedef Documentation

Definition at line 82 of file Buffer.h.

Definition at line 62 of file Object.h.

typedef agx::ref_ptr< const Event > agx::Object::EventConstRef
inherited

Definition at line 62 of file Object.h.

Definition at line 62 of file Object.h.

Definition at line 62 of file Object.h.

typedef Event2<Component *, Object *> agx::Component::ObjectEvent
inherited

Event when adding removing child objects.

NOTE: Events are triggered recursively up the parent structure Example: B is added to root node A, one event is triggered (A.addObjectEvent(A, B)). Then when C is added to B two events are triggered (B.addObjectEvent(B, C), and A.addObjectEvent(B,C))

Definition at line 61 of file Component.h.

Specify a custom element initializer callback.

Definition at line 285 of file Buffer.h.

typedef Callback1<Object*> agx::Component::TraverseCallback
inherited

Definition at line 141 of file Component.h.

Constructor & Destructor Documentation

agxData::Buffer::Buffer ( const agx::Name &  name,
const agxData::Format *  format 
)
agxData::Buffer::Buffer ( const agxData::Format *  format)
virtual agxData::Buffer::~Buffer ( )
protectedvirtual

Reimplemented in agxGL::Buffer.

Member Function Documentation

static Component* agx::Component::_load ( TiXmlElement *  eComponent,
Device *  device 
)
staticinherited
void agxData::Buffer::addListener ( EventListener *  listener)
virtual void agx::Component::addObject ( agx::Object *  object,
bool  assignContext = true 
)
virtualinherited

Add an object to the component.

Parameters
objectThe object to be added
assignContextTrue if the child get the component as the context, set to false to allow 'weak' coupled children
agx::Object::AGX_DECLARE_VECTOR_TYPES ( Event  )
inherited
void* agxData::Buffer::allocateBackBuffer ( )
void agx::Referenced::allocateObserverVector ( ) const
protectedinherited
template<typename T >
T* agx::Referenced::as ( )
inherited

Subclass casting.

Template type must match actual type, dynamic_cast assertion will fail otherwise.

Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), and agx::InternalData::getOrCreate().

template<typename T >
const T* agx::Referenced::as ( ) const
inherited
template<typename T >
T* agx::Referenced::asSafe ( )
inherited

Safe subclass casting, return nullptr if template type does not match.

Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().

template<typename T >
const T* agx::Referenced::asSafe ( ) const
inherited
virtual String agx::Component::autoComplete ( const String &  partialName,
StringVector &  matchingNames 
) const
virtualinherited

Reimplemented in agx::Namespace.

virtual void agxData::Buffer::buildNavigationTree ( agxJson::Value &  eNode) const
overridevirtual

Reimplemented from agx::Component.

size_t agxData::Buffer::capacity ( ) const
Returns
The capacity of the buffer.

Definition at line 460 of file Buffer.h.

References m_capacity.

Referenced by getElement().

static agx::Model* agxData::Buffer::ClassModel ( )
static
void agxData::Buffer::clear ( )

Clear the buffer.

Buffer* agxData::Buffer::clone ( ) const

Clone the buffer.

Buffer* agxData::Buffer::clone ( const agx::IndexRange &  range) const

Clone a subset of the buffer.

Buffer* agxData::Buffer::clone ( const agxData::IndexArray &  indices) const
Buffer* agxData::Buffer::clone ( const agx::IndexVector &  indices) const
void agxData::Buffer::commit ( )
void agxData::Buffer::commit ( agx::IndexRange32  range)
void agxData::Buffer::commit ( agx::Index  index)
void agxData::Buffer::commit ( const agxData::IndexArray &  indexList)
virtual void agx::Component::configure ( TiXmlElement *  eComponent)
overridevirtualinherited

Reimplemented from agx::Object.

Reimplemented in agx::Clock, agx::Task, agx::Kernel, agx::UnresolvedTask, and agx::Clock.

virtual void agxData::Buffer::configure ( agx::TiXmlElement *  eBuffer)
overridevirtual
void agx::Component::configure ( Model *  model)
inherited
static void agxData::Buffer::copy ( Buffer *  target,
const Buffer *  source 
)
static

Copy one buffer to another.

static void agxData::Buffer::copy ( Buffer *  target,
size_t  targetOffset,
const Buffer *  source,
size_t  sourceOffset,
size_t  numElements 
)
static
static void agxData::Buffer::copyGather ( Buffer *  target,
const Buffer *  source,
const agxData::IndexArray &  indices 
)
static
static void agxData::Buffer::copyScatter ( Buffer *  target,
const Buffer *  source,
const agxData::IndexArray &  indices 
)
static
void agxData::Buffer::deleteOverflowBuffer ( void *  buffer,
size_t  numElements 
)
void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited
static void agxData::Buffer::destroyElements ( Buffer *  buffer,
const agx::IndexRange &  range 
)
staticprotected
bool agxData::Buffer::empty ( ) const
Returns
True if the buffer is empty.

Definition at line 461 of file Buffer.h.

References m_size.

String agx::Component::expandAutoCompletionMatch ( const String &  query,
const StringVector &  matchingNames 
) const
protectedinherited
agx::String agx::Object::fullName ( ) const
inherited
Returns
name:implementation

Referenced by agx::ScalarParameter::get(), agx::ArrayParameter::get(), getArray(), and getElement().

agx::String agx::Object::fullPath ( ) const
inherited
Returns
path:implementation
agx::String agx::Object::fullPath ( const agx::Object *  root) const
inherited
static agx::String agx::Object::generateName ( const agx::String &  bindPath)
staticinherited
static const HashSet<Object *>& agx::Object::getActiveObjects ( )
staticinherited
template<typename T >
AbstractArray & agxData::Buffer::getArray ( )

Convenience method to get an direct data array.

Definition at line 495 of file Buffer.h.

References m_array.

Referenced by agxData::AbstractArray::init(), and agxData::AbstractArray::setRange().

template<typename T >
const AbstractArray & agxData::Buffer::getArray ( ) const

Definition at line 496 of file Buffer.h.

References m_array.

Array< T > & agxData::Buffer::getArray ( )

Definition at line 483 of file Buffer.h.

References agxAssertN, agx::Object::fullName(), m_array, and m_format.

const Array< T > & agxData::Buffer::getArray ( ) const

Definition at line 490 of file Buffer.h.

Attribute * agxData::Buffer::getAttribute ( )
Returns
The attribute which the buffer holds data, nullptr if not part of a storage.

Definition at line 471 of file Buffer.h.

References m_attribute.

const Attribute * agxData::Buffer::getAttribute ( ) const

Definition at line 472 of file Buffer.h.

References m_attribute.

agx::Object* agx::Object::getAutoScopedResource ( const agx::Path &  path,
agx::Model *  model = nullptr 
)
inherited
Returns
The resource with the first matching subpath starting from this node and traversing upwards to the root.

Referenced by agx::Object::getAutoScopedResource().

const agx::Object* agx::Object::getAutoScopedResource ( const agx::Path &  path,
agx::Model *  model = nullptr 
) const
inherited
template<typename T >
T * agx::Object::getAutoScopedResource ( const agx::Path &  path)
inherited

Definition at line 428 of file Object.h.

References agx::Object::getAutoScopedResource(), and agx::Referenced::is().

template<typename T >
const T * agx::Object::getAutoScopedResource ( const agx::Path &  path) const
inherited

Definition at line 435 of file Object.h.

T * agx::Object::getContext ( )
inherited
Returns
The parent node in the system tree.

Definition at line 373 of file Object.h.

Referenced by agxData::Value::get(), and agx::Model::getNamespace().

const T * agx::Object::getContext ( ) const
inherited

Definition at line 374 of file Object.h.

template<typename T >
T* agx::Object::getContext ( )
inherited
template<typename T >
const T* agx::Object::getContext ( ) const
inherited
agxData::Value * agxData::Buffer::getDefaultValue ( )
Returns
The default element value.

Definition at line 479 of file Buffer.h.

References m_defaultElementValue.

const agxData::Value * agxData::Buffer::getDefaultValue ( ) const

Definition at line 480 of file Buffer.h.

References m_defaultElementValue.

static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.
T * agx::Component::getDevice ( )
inherited
Returns
The device which the component stored on.

Definition at line 222 of file Component.h.

Referenced by agx::Component::getDevice().

const T * agx::Component::getDevice ( ) const
inherited

Definition at line 223 of file Component.h.

References agx::Component::getDevice().

template<typename T >
T* agx::Component::getDevice ( )
inherited
template<typename T >
const T* agx::Component::getDevice ( ) const
inherited
template<typename T >
void * agxData::Buffer::getElement ( size_t  index)
Returns
A specific element in the buffer.

Definition at line 517 of file Buffer.h.

References agxAssert, agxAssertN, capacity(), agx::Object::fullName(), getFormat(), agx::Referenced::is(), agxCore::isShutdown(), and m_ptr.

Referenced by agxData::EntityStorage::get().

template<typename T >
const void * agxData::Buffer::getElement ( size_t  index) const

Definition at line 529 of file Buffer.h.

void* agxData::Buffer::getElement ( size_t  index)
Returns
The raw data of a specific element in the buffer.
const void* agxData::Buffer::getElement ( size_t  index) const
size_t agxData::Buffer::getElementArraySize ( ) const
Returns
The array size. (used for ArrayAttribute in an EntityStorage)

Definition at line 466 of file Buffer.h.

References agx::ref_ptr< T >::get().

Referenced by agx::ArrayParameter::getNumElements().

Buffer * agxData::Buffer::getElementBuffer ( )

If the buffer contains arrays/vectors, the actual elements are stored in another buffer.

Definition at line 554 of file Buffer.h.

References m_elementBuffer.

const Buffer * agxData::Buffer::getElementBuffer ( ) const

Definition at line 555 of file Buffer.h.

References m_elementBuffer.

static bool agx::Object::getEnableRebind ( )
staticinherited

Should rebinding be allowed? Right now a global setting.

Format * agxData::Buffer::getFormat ( )
const Format * agxData::Buffer::getFormat ( ) const

Definition at line 477 of file Buffer.h.

References m_format.

Buffer * agxData::Buffer::getGlobalOrderBuffer ( )

If the buffer is used as a global result, we provide a permutation buffer for parallel determinism.

Definition at line 557 of file Buffer.h.

References m_globalOrderBuffer.

const Buffer * agxData::Buffer::getGlobalOrderBuffer ( ) const

Definition at line 558 of file Buffer.h.

References m_globalOrderBuffer.

agx::GlobalResultBuffer * agxData::Buffer::getGlobalResult ( )
Returns
The global result bound to this buffer.

Definition at line 548 of file Buffer.h.

References m_globalResult.

const agx::GlobalResultBuffer * agxData::Buffer::getGlobalResult ( ) const

Definition at line 549 of file Buffer.h.

References m_globalResult.

UInt32 agx::Object::getId ( ) const
inherited
Returns
The global object id.

Definition at line 370 of file Object.h.

Referenced by agxData::EntityStorage::indexToId().

const agx::Name& agx::Object::getImplementationName ( ) const
inherited
Returns
The implementation name of the model. Alias for getModel()->getImplementationName()
Model * agx::Object::getModel ( )
inherited
Returns
The object model.

Definition at line 371 of file Object.h.

const Model * agx::Object::getModel ( ) const
inherited

Definition at line 372 of file Object.h.

const Name & agx::Object::getName ( ) const
inherited
Returns
Then name of the object.

Definition at line 369 of file Object.h.

Referenced by agxData::Value::get(), agxData::EntityStorage::get(), agxData::FormatBinding< T >::getFormat(), and agxData::EntityPtr::operator()().

agx::Object* agx::Object::getNextSibling ( )
inherited
Returns
The next sibling with identical name.
const agx::Object* agx::Object::getNextSibling ( ) const
inherited
size_t agx::Component::getNumObjects ( const agx::Name &  name) const
inherited
Returns
The number of child objects with a specified name.
T * agx::Component::getObject ( const agx::Name &  name,
size_t  index = 0 
)
inherited
Returns
The child object with specified name (and optional index).

Definition at line 194 of file Component.h.

Referenced by agxData::EntityPtr::operator()().

const T * agx::Component::getObject ( const agx::Name &  name,
size_t  index = 0 
) const
inherited

Definition at line 195 of file Component.h.

Object * agx::Component::getObject ( const agx::Name &  name,
agx::Model *  model,
size_t  index = 0 
)
inherited

Definition at line 197 of file Component.h.

const Object * agx::Component::getObject ( const agx::Name &  name,
agx::Model *  model,
size_t  index = 0 
) const
inherited

Definition at line 198 of file Component.h.

template<typename T >
T* agx::Component::getObject ( const agx::Name &  name,
size_t  index = 0 
)
inherited
template<typename T >
const T* agx::Component::getObject ( const agx::Name &  name,
size_t  index = 0 
) const
inherited
const ObjectRefVector & agx::Component::getObjects ( ) const
inherited
Returns
All child objects.

Definition at line 192 of file Component.h.

Referenced by agx::Component::getObjects().

template<typename T >
void agx::Component::getObjects ( agx::ObjectPtrVector &  result,
bool  recursive = false 
) const
inherited
Returns
All child objects of a specified type.
void agx::Component::getObjects ( agx::ObjectPtrVector &  result,
const agx::Model *  model,
bool  recursive = false 
) const
inherited
template<typename T >
void agx::Component::getObjects ( ObjectPtrVector &  result,
bool  recursive 
) const
inherited

Definition at line 241 of file Component.h.

References agx::Component::getObjects().

Buffer* agxData::Buffer::getOrCreateGlobalOrderBuffer ( )
Buffer* agxData::Buffer::getOriginalBuffer ( )
const Buffer* agxData::Buffer::getOriginalBuffer ( ) const
agx::Path agx::Object::getPath ( const agx::Object *  root) const
inherited
Returns
A relative path from a specified root
Parameters
rootA node along the parent path from this object.
int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.
const agxData::Value::Event::CallbackType& agxData::Buffer::getReserveCallback ( ) const
const agxData::Value::Event::CallbackType& agxData::Buffer::getResizeCallback ( ) const
agx::Object* agx::Object::getResource ( const agx::Path &  path,
agx::Model *  model = nullptr 
)
inherited
Returns
A resource in the subtree below this object.

Referenced by agx::Object::getResource().

const agx::Object* agx::Object::getResource ( const agx::Path &  path,
agx::Model *  model = nullptr 
) const
inherited
template<typename T >
T * agx::Object::getResource ( const agx::Path &  path)
inherited

Definition at line 414 of file Object.h.

References agx::Object::getResource(), and agx::Referenced::is().

template<typename T >
const T * agx::Object::getResource ( const agx::Path &  path) const
inherited

Definition at line 421 of file Object.h.

virtual Object* agx::Component::getResourceImpl ( const Path &  path,
agx::Model *  model 
)
overridevirtualinherited

Reimplemented from agx::Object.

Reimplemented in agx::Task, and agxData::EntityStorage.

agx::UInt64 agxData::Buffer::getRevision ( ) const
Returns
The revision counter

Definition at line 464 of file Buffer.h.

References m_revision.

agx::Object* agx::Object::getRootContext ( )
inherited
Returns
The root context.
const agx::Object* agx::Object::getRootContext ( ) const
inherited
EntityStorage * agxData::Buffer::getStorage ( )
Returns
The storage which the buffer is part of.

Definition at line 468 of file Buffer.h.

References m_storage.

Referenced by agxData::Vector< T >::Vector().

const EntityStorage * agxData::Buffer::getStorage ( ) const

Definition at line 469 of file Buffer.h.

References m_storage.

Type * agxData::Buffer::getType ( )
Returns
The type of the buffer.

Definition at line 474 of file Buffer.h.

References m_format.

const Type * agxData::Buffer::getType ( ) const

Definition at line 475 of file Buffer.h.

References m_format.

bool agxData::Buffer::hasListener ( EventListener *  listener)
bool agx::Object::hasParent ( const agx::Object *  node) const
inherited
Returns
True if the specified node is located somewhere in the path above the object.
void agxData::Buffer::initialize ( const agx::IndexRange &  range)

Initialize a range of elements.

static void agxData::Buffer::initializeElements ( Buffer *  buffer,
const agx::IndexRange &  range 
)
staticprotected
template<typename T >
bool agx::Referenced::is ( ) const
inherited
bool agx::Object::isUnique ( ) const
inherited

Definition at line 375 of file Object.h.

void* agxData::Buffer::kernelOverflowReallocation ( size_t  size)
static Component* agx::Component::load ( const String &  path,
const Path &  _namespace = Path() 
)
staticinherited
static Component* agx::Component::load ( const String &  path,
Device *  device,
const Path &  _namespace = Path() 
)
staticinherited
static Component* agx::Component::load ( const Path &  path,
const Name &  implementation,
Device *  device,
const Path &  _namespace = Path() 
)
staticinherited
static Component* agx::Component::load ( TiXmlElement *  eComponent,
Device *  device 
)
staticinherited
static Buffer* agxData::Buffer::load ( agx::TiXmlElement *  eBuffer,
agx::Device *  device 
)
static
T * agx::Object::load ( const String &  path,
Device *  device,
const String &  type = "",
size_t  instance = 0 
)
staticinherited

Definition at line 379 of file Object.h.

References agx::Object::load().

T * agx::Object::load ( const String &  path,
Device *  device,
const String &  type,
const String &  attribute,
const String &  value 
)
staticinherited

Definition at line 386 of file Object.h.

References agx::Object::load().

static void agx::Object::load ( const String &  path,
Device *  device,
ObjectPtrVector &  loadedObjects 
)
staticinherited
static TiXmlDocument agx::Object::openDocument ( const String &  path)
staticinherited
void agxData::Buffer::presize ( size_t  size,
size_t  initialSize 
)
void agxData::Buffer::print ( ) const

Print the buffer.

void agxData::Buffer::print ( agx::IndexRange  range) const
void agxData::Buffer::print ( std::ostream &  stream) const
void agxData::Buffer::print ( std::ostream &  stream,
agx::IndexRange  range 
) const
virtual void agx::Component::printSubtree ( ) const
overridevirtualinherited

Reimplemented from agx::Object.

void agx::Component::printSubtree ( std::ostream &  stream,
int  depth = 0 
) const
inherited
T * agxData::Buffer::ptr ( )

Get access to the raw data buffer.

Definition at line 499 of file Buffer.h.

References m_ptr.

Referenced by agxData::AbstractArray::sync().

const T * agxData::Buffer::ptr ( ) const

Definition at line 500 of file Buffer.h.

References m_ptr.

template<typename T >
T* agxData::Buffer::ptr ( )
template<typename T >
const T* agxData::Buffer::ptr ( ) const
virtual void agxData::Buffer::reallocate ( size_t  size)
protectedvirtual

Reimplemented in agxGL::Buffer.

virtual void agx::Component::rebind ( )
overridevirtualinherited

Reimplemented from agx::Object.

Reimplemented in agx::Task, and agx::Clock.

void agx::Referenced::reference ( void *  ptr = nullptr) const
inherited

Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.

This method should be used with care, always balanced with the same number of calls to unreference.

Referenced by agxData::Val< UInt >::Val().

void agxData::Buffer::registerSharedContainer ( agx::Container *  container)
void agx::Component::removeAllObjects ( )
inherited

Remove all components.

void agxData::Buffer::removeListener ( EventListener *  listener)
virtual void agx::Component::removeObject ( agx::Object *  object)
virtualinherited

Remove an object from the component.

void agx::Component::removeObject ( const agx::Name &  name,
size_t  index = 0 
)
inherited

Remove an object with a specified name (and optional index) from the component.

void agxData::Buffer::reserve ( size_t  size)

Reserve space for future buffer expansion.

void agxData::Buffer::resize ( size_t  size,
bool  initializeElements = true 
)

Resize the buffer.

virtual void agx::Object::save ( TiXmlElement *  ) const
inlinevirtualinherited

Reimplemented in agx::Clock.

Definition at line 105 of file Object.h.

virtual void agx::Object::setContext ( agx::Object *  context)
virtualinherited

Reimplemented in agx::Task, and agxData::FunctionValue.

void agxData::Buffer::setDefaultValue ( agxData::Value *  value)

Set the default element value.

static void agx::Referenced::setDeleteHandler ( DeleteHandler *  handler)
staticprotectedinherited

Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.

void agx::Component::setDevice ( Device *  device)
protectedinherited
void agxData::Buffer::setElementBuffer ( Buffer *  buffer)

Set the element buffer, internal use only.

void agxData::Buffer::setElementDestructor ( const RangeCallback &  callback)
void agxData::Buffer::setElementInitializer ( const RangeCallback &  callback)
static void agx::Object::setEnableRebind ( bool  flag)
staticinherited

Sets if rebinding of objects should be allowed (Right now a global setting).

Allowing it when adding larger parts to the system tree might hit performance, so it might be smarter to disable it first, then add, and then enable again.

void agx::Object::setId ( UInt32  id)
inherited
void agx::Object::setModel ( agx::Model *  model)
inherited

Set the object model (handled automatically).

void agx::Object::setName ( const agx::Name &  name)
inherited

Set the name of the object.

void agxData::Buffer::setRevision ( agx::UInt64  revision)
size_t agxData::Buffer::size ( ) const
Returns
The size of the buffer.

Definition at line 459 of file Buffer.h.

References m_size.

Referenced by agx::ArrayParameter::getNumElements(), agxData::AbstractArray::init(), and agxData::AbstractArray::setRange().

virtual void agx::Component::snapshot ( TiXmlNode *  eParent,
const String &  directory 
) const
overridevirtualinherited

Reimplemented from agx::Object.

virtual void agxData::Buffer::snapshot ( agx::TiXmlNode *  eParent,
const agx::String &  directory 
) const
overridevirtual
void agxData::Buffer::swapBackBuffer ( void *  backBuffer)
void agx::Component::traverse ( const TraverseCallback &  callback)
inherited
void agx::Component::traverse ( ComponentVisitor *  )
inherited
void agx::Referenced::unreference ( void *  ptr = nullptr) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.

This method should be used with care, always balanced with the same number of calls to reference.

void agx::Referenced::unreference_nodelete ( ) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.

void agxData::Buffer::unregisterSharedContainer ( agx::Container *  container)
template<typename T >
static bool agx::Referenced::ValidateCast ( const Referenced *  object)
staticinherited

Member Data Documentation

ObjectEvent agx::Component::addObjectEvent
inherited

Definition at line 63 of file Component.h.

agx::UInt agxData::Buffer::ALIGNMENT
static

Definition at line 67 of file Buffer.h.

agx::Real agxData::Buffer::CAPACITY_MULTIPLIER
static
agxData::ValueRefT<agx::UInt> agxData::Buffer::capacityParameter

Definition at line 79 of file Buffer.h.

agx::ByteAllocator agxData::Buffer::m_allocator
protected

Definition at line 341 of file Buffer.h.

AbstractArray agxData::Buffer::m_array
protected

Definition at line 342 of file Buffer.h.

Referenced by getArray().

Attribute* agxData::Buffer::m_attribute
protected

Definition at line 346 of file Buffer.h.

Referenced by getAttribute().

size_t agxData::Buffer::m_capacity
protected

Definition at line 337 of file Buffer.h.

Referenced by capacity().

agxData::ValueRef agxData::Buffer::m_defaultElementValue
protected

Definition at line 348 of file Buffer.h.

Referenced by getDefaultValue().

RangeCallback agxData::Buffer::m_destructor
protected

Definition at line 358 of file Buffer.h.

agxData::BufferRef agxData::Buffer::m_elementBuffer
protected

Definition at line 349 of file Buffer.h.

Referenced by getElementBuffer().

EventDispatch agxData::Buffer::m_eventDispatch
protected

Definition at line 355 of file Buffer.h.

FormatRef agxData::Buffer::m_format
protected

Definition at line 347 of file Buffer.h.

Referenced by getArray(), getFormat(), and getType().

agxData::BufferRef agxData::Buffer::m_globalOrderBuffer
protected

Definition at line 350 of file Buffer.h.

Referenced by getGlobalOrderBuffer().

agx::GlobalResultBuffer* agxData::Buffer::m_globalResult
protected

Definition at line 354 of file Buffer.h.

Referenced by getGlobalResult().

bool agxData::Buffer::m_initElements
protected

Definition at line 343 of file Buffer.h.

RangeCallback agxData::Buffer::m_initializer
protected

Definition at line 357 of file Buffer.h.

Mutex agx::Referenced::m_mutex
mutableprotectedinherited

Definition at line 240 of file Referenced.h.

ObserverContainer agx::Referenced::m_observers
mutableprotectedinherited

Definition at line 239 of file Referenced.h.

agxData::Buffer* agxData::Buffer::m_originalBuffer
protected

Definition at line 362 of file Buffer.h.

void* agxData::Buffer::m_ptr
protected

Definition at line 340 of file Buffer.h.

Referenced by getElement(), and ptr().

AtomicValue agx::Referenced::m_refCount
mutableprotectedinherited

Definition at line 241 of file Referenced.h.

agxData::Value::Event::CallbackType agxData::Buffer::m_reserveCallback
protected

Definition at line 353 of file Buffer.h.

agxData::Value::Event::CallbackType agxData::Buffer::m_resizeCallback
protected

Definition at line 352 of file Buffer.h.

agx::UInt64 agxData::Buffer::m_revision
protected

Definition at line 338 of file Buffer.h.

Referenced by getRevision().

agx::Container* agxData::Buffer::m_sharedContainer
protected

Definition at line 351 of file Buffer.h.

agxData::ShareHandleRef agxData::Buffer::m_shareHandle
protected

Definition at line 361 of file Buffer.h.

size_t agxData::Buffer::m_size
protected

Definition at line 336 of file Buffer.h.

Referenced by empty(), and size().

EntityStorage* agxData::Buffer::m_storage
protected

Definition at line 345 of file Buffer.h.

Referenced by getStorage().

bool agxData::Buffer::m_usedResizeMethod
protected

Definition at line 344 of file Buffer.h.

agx::UInt agxData::Buffer::MIN_BUFFER_CAPACITY
static

Definition at line 66 of file Buffer.h.

Event agxData::Buffer::reallocationEvent

Triggered when buffer is reallocated.

Definition at line 85 of file Buffer.h.

ObjectEvent agx::Component::removeObjectEvent
inherited

Definition at line 64 of file Component.h.

agxData::ValueRefT<agx::UInt> agxData::Buffer::sizeParameter

Definition at line 78 of file Buffer.h.


The documentation for this class was generated from the following file: