ug4
|
A generic specialization of IAttachedDataContainer. More...
#include <attachment_pipe.h>
Public Types | |
typedef T | ValueType |
Public Member Functions | |
AttachmentDataContainer (const T &defaultValue=T()) | |
virtual void | copy_data (size_t indFrom, size_t indTo) |
copy data from entry indFrom to entry indTo. More... | |
virtual void | copy_to_container (IAttachmentDataContainer *pDestCon, int *indexMap, int num) const |
virtual void | defragment (size_t *pNewIndices, size_t numValidElements) |
TRef | get_elem (size_t index) |
TConstRef | get_elem (size_t index) const |
virtual size_t | occupied_memory () |
returns the memory occupied by the container More... | |
TRef | operator[] (size_t index) |
TConstRef | operator[] (size_t index) const |
virtual void | reset_entry (size_t index) |
resets the entry to its default value. More... | |
virtual void | resize (size_t iSize) |
resize the data array More... | |
virtual size_t | size () |
returns the size of the data-array. More... | |
void | swap (AttachmentDataContainer< T > &container) |
swaps the buffer content of associated data More... | |
virtual | ~AttachmentDataContainer () |
Public Member Functions inherited from ug::IAttachmentDataContainer | |
virtual | ~IAttachmentDataContainer () |
Protected Member Functions | |
DataContainer & | get_data_container () |
Protected Attributes | |
T | m_defaultValue |
DataContainer | m_vData |
Private Types | |
typedef AttachmentDataContainer< T > | ClassType |
typedef std::vector< T > | DataContainer |
typedef attachment_value_traits< T >::const_reference | TConstRef |
typedef attachment_value_traits< T >::reference | TRef |
A generic specialization of IAttachedDataContainer.
This template-class not only simplifies the creation of custom containers, it also defines some types, operators and values, which are essential to use an AttachmentDataContainer with libGrid. In particular libGrids AttachmentAccessors require these definitions.
|
private |
|
private |
|
private |
|
private |
typedef T ug::AttachmentDataContainer< T >::ValueType |
|
inline |
|
inlinevirtual |
|
inlinevirtual |
copy data from entry indFrom to entry indTo.
Implements ug::IAttachmentDataContainer.
|
inlinevirtual |
copies entries from the this-container to the container specified by pDestCon. For the i-th entry in the target container, pIndexMap has to contain the index of the associated source entry in this container. num specifies the number of entries to be copied. Make sure, that pDest can hold 'num' elements.
pDestCon has to have the same or a derived dynamic type as the container on which this method is called.
Implements ug::IAttachmentDataContainer.
References ug::AttachmentDataContainer< T >::get_data_container().
|
inlinevirtual |
defragment should clear the containers data from unused entries. pNewIndices should be an array of indices, wich holds a new index for each entry in IAttachedDataContainer. pNewIndices has thus to hold as many indices as there are entries in IAttachedDataContainer. If an entry shall not appear in the defragmented container, its new index has to be set to INVALID_ATTACHMENT_INDEX. numValidElements has to specify the size of the defragmented container - it thus has to equal the number of valid indices in pNewIndices.
Implements ug::IAttachmentDataContainer.
References ug::INVALID_ATTACHMENT_INDEX.
|
inlineprotected |
Referenced by ug::AttachmentDataContainer< T >::copy_to_container().
|
inline |
|
inline |
Referenced by ug::Grid::reset_marks().
|
inlinevirtual |
returns the memory occupied by the container
Implements ug::IAttachmentDataContainer.
|
inline |
|
inline |
|
inlinevirtual |
resets the entry to its default value.
Implements ug::IAttachmentDataContainer.
|
inlinevirtual |
resize the data array
Implements ug::IAttachmentDataContainer.
|
inlinevirtual |
returns the size of the data-array.
Implements ug::IAttachmentDataContainer.
Referenced by ug::Grid::reset_marks().
|
inline |
swaps the buffer content of associated data
References ug::AttachmentDataContainer< T >::m_vData.
|
protected |
|
protected |
Referenced by ug::AttachmentDataContainer< T >::swap().