PixelLightAPI
.
|
#include <Array.h>
Public Member Functions | |
Array (uint32 nMaxNumOfElements=0, bool bAdded=true, bool bInit=false) | |
Constructor. | |
Array (const Array< ValueType > &lstSource, uint32 nStart=0, uint32 nCount=0) | |
Copy constructor. | |
Array (const Container< ValueType > &lstSource, uint32 nStart=0, uint32 nCount=0) | |
Copy constructor. | |
virtual | ~Array () |
Destructor. | |
Container< ValueType > & | operator= (const Array< ValueType > &lstSource) |
Copy operator. | |
uint32 | GetMaxNumOfElements () const |
Returns the maximum number of elements in the array. | |
bool | Resize (uint32 nMaxNumOfElements, bool bAdded=true, bool bInit=false) |
Sets the maximum number of elements in the array. | |
uint32 | GetResizeCount () const |
Returns the number of elements automatically added if the array size is to small. | |
bool | SetResizeCount (uint32 nCount=10) |
Sets the number of elements automatically added if the array size is to small. | |
ValueType * | GetData () const |
Returns the array data. | |
void | Reset () |
Resets the array. | |
void | MoveElement (uint32 nFromIndex, uint32 nToIndex) |
Moves an element within the array. | |
virtual Iterator< ValueType > | GetIterator (uint32 nIndex=0) const override |
Returns an iterator operating on the derived data structure. | |
virtual ConstIterator< ValueType > | GetConstIterator (uint32 nIndex=0) const override |
Returns a constant iterator operating on the derived data structure. | |
virtual Iterator< ValueType > | GetEndIterator () const override |
Returns an iterator operating on the derived data structure and starting at the end. | |
virtual ConstIterator< ValueType > | GetConstEndIterator () const override |
Returns a constant iterator operating on the derived data structure and starting at the end. | |
virtual bool | IsEmpty () const override |
Checks whether the container is complete empty. | |
virtual uint32 | GetNumOfElements () const override |
Returns the number of elements. | |
virtual uint32 | GetElementSize () const override |
Returns the size of a single container element (in bytes) | |
virtual uint32 | GetSize () const override |
Returns the total size of all container elements (in bytes) | |
virtual void | Clear () override |
Clears the whole container. | |
virtual bool | IsElement (const ValueType &Element) const override |
Returns whether the given element is within the container or not. | |
virtual int | GetIndex (const ValueType &Element) const override |
Returns the index of an element (first appearance) | |
virtual ValueType & | Get (uint32 nIndex) const override |
Returns an element. | |
virtual ValueType & | operator[] (uint32 nIndex) const override |
Returns an element. | |
virtual bool | Replace (const ValueType &Element1, const ValueType &Element2) override |
Replaces an element (first appearance) through another element. | |
virtual bool | ReplaceAtIndex (uint32 nIndex, const ValueType &Element) override |
Replaces an element at the given index through another element. | |
virtual ValueType & | Add () override |
Appends an element to the container. | |
virtual ValueType & | Add (const ValueType &Element) override |
Appends an element to the container. | |
virtual uint32 | Add (const ValueType *pElements, uint32 nCount) override |
Adds elements from a given C-array. | |
virtual Container< ValueType > & | operator+= (const ValueType &Element) override |
Appends an element to the container. | |
virtual bool | Add (const Container< ValueType > &lstContainer, uint32 nStart=0, uint32 nCount=0) override |
Appends an container to this container. | |
virtual Container< ValueType > & | operator+= (const Container< ValueType > &lstContainer) override |
Appends an container to this container. | |
virtual ValueType & | AddAtIndex (int nIndex) override |
Appends an element to the container at the given index. | |
virtual ValueType & | AddAtIndex (const ValueType &Element, int nIndex) override |
Appends an element to the container at the given index. | |
virtual bool | Remove (const ValueType &Element) override |
Removes an element (first appearance) from the container. | |
virtual bool | RemoveAtIndex (uint32 nElement) override |
Removes the element at the given index from the container. | |
virtual Container< ValueType > & | operator-= (const ValueType &Element) override |
Removes an element from the container. | |
virtual bool | Remove (const Container< ValueType > &lstContainer, uint32 nStart=0, uint32 nCount=0) override |
Removes the elements of an container from this container. | |
virtual Container< ValueType > & | operator-= (const Container< ValueType > &lstContainer) override |
Removes the elements of an container from this container. | |
virtual bool | Copy (const Container< ValueType > &lstContainer, uint32 nStart=0, uint32 nCount=0) override |
Makes this container to a copy of another container. | |
virtual Container< ValueType > & | operator= (const Container< ValueType > &lstContainer) override |
Makes this container to a copy of another container. | |
virtual bool | Compare (const Container< ValueType > &lstContainer, uint32 nStart=0, uint32 nCount=0) const override |
Compares two containers. | |
virtual bool | operator== (const Container< ValueType > &lstContainer) const override |
Compares two containers. | |
virtual bool | operator!= (const Container< ValueType > &lstContainer) const override |
Compares two containers. |
Array class.
PLCore::Array< ValueType >::Array | ( | uint32 | nMaxNumOfElements = 0 , |
bool | bAdded = true , |
||
bool | bInit = false |
||
) |
[in] | nMaxNumOfElements | Maximum number of elements within the array |
[in] | bAdded | Are all elements added? (GetNumOfElements() = GetMaxNumOfElements()) |
[in] | bInit | Initialize new elements by setting them to null? |
PLCore::Array< ValueType >::Array | ( | const Array< ValueType > & | lstSource, |
uint32 | nStart = 0 , |
||
uint32 | nCount = 0 |
||
) |
Copy constructor.
[in] | lstSource | Array to copy from |
[in] | nStart | Index the copy operation should start |
[in] | nCount | Number of elements to copy, if 0 copy all elements of lstSource behind nStart |
PLCore::Array< ValueType >::Array | ( | const Container< ValueType > & | lstSource, |
uint32 | nStart = 0 , |
||
uint32 | nCount = 0 |
||
) |
Copy constructor.
[in] | lstSource | Container to copy from |
[in] | nStart | Index the copy operation should start |
[in] | nCount | Number of elements to copy, if 0 copy all elements of lstSource behind nStart |
PLCore::Array< ValueType >::~Array | ( | ) | [virtual] |
Destructor.
Container< ValueType > & PLCore::Array< ValueType >::operator= | ( | const Array< ValueType > & | lstSource | ) |
uint32 PLCore::Array< ValueType >::GetMaxNumOfElements | ( | ) | const |
Returns the maximum number of elements in the array.
bool PLCore::Array< ValueType >::Resize | ( | uint32 | nMaxNumOfElements, |
bool | bAdded = true , |
||
bool | bInit = false |
||
) |
Sets the maximum number of elements in the array.
Sets the number of elements in the array.
[in] | nMaxNumOfElements | New maximum number of elements (0 = clear array) |
[in] | bAdded | Are all elements added? (GetNumOfElements() = GetMaxNumOfElements()) |
[in] | bInit | Initialize new elements by setting them to null? |
uint32 PLCore::Array< ValueType >::GetResizeCount | ( | ) | const |
Returns the number of elements automatically added if the array size is to small.
bool PLCore::Array< ValueType >::SetResizeCount | ( | uint32 | nCount = 10 | ) |
Sets the number of elements automatically added if the array size is to small.
[in] | nCount | Number of elements automatically added if the array size is to small |
ValueType * PLCore::Array< ValueType >::GetData | ( | ) | const |
Returns the array data.
void PLCore::Array< ValueType >::Reset | ( | ) |
Resets the array.
void PLCore::Array< ValueType >::MoveElement | ( | uint32 | nFromIndex, |
uint32 | nToIndex | ||
) |
Moves an element within the array.
[in] | nFromIndex | The index of the element which should be moved |
[in] | nToIndex | The index to which the element should be moved |
Iterator< ValueType > PLCore::Array< ValueType >::GetIterator | ( | uint32 | nIndex = 0 | ) | const [override, virtual] |
Returns an iterator operating on the derived data structure.
[in] | nIndex | Start index, if >= 'total number of elements' the index is set to the last valid index |
Implements PLCore::Iterable< ValueType >.
ConstIterator< ValueType > PLCore::Array< ValueType >::GetConstIterator | ( | uint32 | nIndex = 0 | ) | const [override, virtual] |
Returns a constant iterator operating on the derived data structure.
[in] | nIndex | Start index, if >= 'total number of elements' the index is set to the last valid index |
Implements PLCore::Iterable< ValueType >.
Iterator< ValueType > PLCore::Array< ValueType >::GetEndIterator | ( | ) | const [override, virtual] |
Returns an iterator operating on the derived data structure and starting at the end.
Implements PLCore::Iterable< ValueType >.
ConstIterator< ValueType > PLCore::Array< ValueType >::GetConstEndIterator | ( | ) | const [override, virtual] |
Returns a constant iterator operating on the derived data structure and starting at the end.
Implements PLCore::Iterable< ValueType >.
bool PLCore::Array< ValueType >::IsEmpty | ( | ) | const [override, virtual] |
Checks whether the container is complete empty.
Implements PLCore::Container< ValueType >.
uint32 PLCore::Array< ValueType >::GetNumOfElements | ( | ) | const [override, virtual] |
Returns the number of elements.
Implements PLCore::Container< ValueType >.
uint32 PLCore::Array< ValueType >::GetElementSize | ( | ) | const [override, virtual] |
Returns the size of a single container element (in bytes)
Implements PLCore::Container< ValueType >.
uint32 PLCore::Array< ValueType >::GetSize | ( | ) | const [override, virtual] |
Returns the total size of all container elements (in bytes)
Implements PLCore::Container< ValueType >.
void PLCore::Array< ValueType >::Clear | ( | ) | [override, virtual] |
Clears the whole container.
Implements PLCore::Container< ValueType >.
bool PLCore::Array< ValueType >::IsElement | ( | const ValueType & | Element | ) | const [override, virtual] |
Returns whether the given element is within the container or not.
Implements PLCore::Container< ValueType >.
int PLCore::Array< ValueType >::GetIndex | ( | const ValueType & | Element | ) | const [override, virtual] |
Returns the index of an element (first appearance)
Implements PLCore::Container< ValueType >.
ValueType & PLCore::Array< ValueType >::Get | ( | uint32 | nIndex | ) | const [override, virtual] |
Returns an element.
[in] | nIndex | Index of the element to return |
Implements PLCore::Container< ValueType >.
ValueType & PLCore::Array< ValueType >::operator[] | ( | uint32 | nIndex | ) | const [override, virtual] |
Returns an element.
[in] | nIndex | Index of the element to return |
Implements PLCore::Container< ValueType >.
bool PLCore::Array< ValueType >::Replace | ( | const ValueType & | Element1, |
const ValueType & | Element2 | ||
) | [override, virtual] |
Replaces an element (first appearance) through another element.
[in] | Element1 | Element to replace |
[in] | Element2 | The element which should replace the old one |
Implements PLCore::Container< ValueType >.
bool PLCore::Array< ValueType >::ReplaceAtIndex | ( | uint32 | nIndex, |
const ValueType & | Element | ||
) | [override, virtual] |
Replaces an element at the given index through another element.
[in] | nIndex | Index of the element to replace |
[in] | Element | The element which should replace the old one |
Implements PLCore::Container< ValueType >.
ValueType & PLCore::Array< ValueType >::Add | ( | ) | [override, virtual] |
Appends an element to the container.
Implements PLCore::Container< ValueType >.
ValueType & PLCore::Array< ValueType >::Add | ( | const ValueType & | Element | ) | [override, virtual] |
Appends an element to the container.
Implements PLCore::Container< ValueType >.
uint32 PLCore::Array< ValueType >::Add | ( | const ValueType * | pElements, |
uint32 | nCount | ||
) | [override, virtual] |
Adds elements from a given C-array.
[in] | pElements | Pointer to C-array with the elements to add, if a null pointer, nothing is done |
[in] | nCount | Number of elements to add, the given C-array MUST have at least nCount elements! |
Implements PLCore::Container< ValueType >.
Container< ValueType > & PLCore::Array< ValueType >::operator+= | ( | const ValueType & | Element | ) | [override, virtual] |
Appends an element to the container.
Implements PLCore::Container< ValueType >.
bool PLCore::Array< ValueType >::Add | ( | const Container< ValueType > & | lstContainer, |
uint32 | nStart = 0 , |
||
uint32 | nCount = 0 |
||
) | [override, virtual] |
Appends an container to this container.
[in] | lstContainer | Container to add |
[in] | nStart | Index the copy operation should start |
[in] | nCount | Number of elements to copy, if 0 copy all elements of lstContainer behind nStart |
Implements PLCore::Container< ValueType >.
Container< ValueType > & PLCore::Array< ValueType >::operator+= | ( | const Container< ValueType > & | lstContainer | ) | [override, virtual] |
Appends an container to this container.
[in] | lstContainer | Container to add |
Implements PLCore::Container< ValueType >.
ValueType & PLCore::Array< ValueType >::AddAtIndex | ( | int | nIndex | ) | [override, virtual] |
Appends an element to the container at the given index.
[in] | nIndex | Index were to add the new element, if < 0 add at end, must be <= 'GetNumOfElements()' |
Implements PLCore::Container< ValueType >.
ValueType & PLCore::Array< ValueType >::AddAtIndex | ( | const ValueType & | Element, |
int | nIndex | ||
) | [override, virtual] |
Appends an element to the container at the given index.
[in] | Element | Element to add |
[in] | nIndex | Index were to add the new element, if < 0 add at end, must be <= 'GetNumOfElements()' |
Implements PLCore::Container< ValueType >.
bool PLCore::Array< ValueType >::Remove | ( | const ValueType & | Element | ) | [override, virtual] |
Removes an element (first appearance) from the container.
Implements PLCore::Container< ValueType >.
bool PLCore::Array< ValueType >::RemoveAtIndex | ( | uint32 | nElement | ) | [override, virtual] |
Removes the element at the given index from the container.
[in] | nElement | Index of the element to remove |
Implements PLCore::Container< ValueType >.
Container< ValueType > & PLCore::Array< ValueType >::operator-= | ( | const ValueType & | Element | ) | [override, virtual] |
Removes an element from the container.
Implements PLCore::Container< ValueType >.
bool PLCore::Array< ValueType >::Remove | ( | const Container< ValueType > & | lstContainer, |
uint32 | nStart = 0 , |
||
uint32 | nCount = 0 |
||
) | [override, virtual] |
Removes the elements of an container from this container.
[in] | lstContainer | Container to remove the elements from this container |
[in] | nStart | Index the remove operation should start |
[in] | nCount | Number of elements to remove, if 0 remove all elements of lstContainer behind nStart |
Implements PLCore::Container< ValueType >.
Container< ValueType > & PLCore::Array< ValueType >::operator-= | ( | const Container< ValueType > & | lstContainer | ) | [override, virtual] |
Removes the elements of an container from this container.
[in] | lstContainer | Container to remove the elements from this container |
Implements PLCore::Container< ValueType >.
bool PLCore::Array< ValueType >::Copy | ( | const Container< ValueType > & | lstContainer, |
uint32 | nStart = 0 , |
||
uint32 | nCount = 0 |
||
) | [override, virtual] |
Makes this container to a copy of another container.
[in] | lstContainer | Container to copy from |
[in] | nStart | Index the copy operation should start |
[in] | nCount | Number of elements to copy, if 0 copy all elements of lstContainer behind nStart |
Implements PLCore::Container< ValueType >.
Container< ValueType > & PLCore::Array< ValueType >::operator= | ( | const Container< ValueType > & | lstContainer | ) | [override, virtual] |
Makes this container to a copy of another container.
[in] | lstContainer | Container to copy from |
Implements PLCore::Container< ValueType >.
bool PLCore::Array< ValueType >::Compare | ( | const Container< ValueType > & | lstContainer, |
uint32 | nStart = 0 , |
||
uint32 | nCount = 0 |
||
) | const [override, virtual] |
Compares two containers.
[in] | lstContainer | Container to compare with |
[in] | nStart | Index the compare operation should start |
[in] | nCount | Number of elements to compare, if 0 compare all elements of lstContainer behind nStart |
Implements PLCore::Container< ValueType >.
bool PLCore::Array< ValueType >::operator== | ( | const Container< ValueType > & | lstContainer | ) | const [override, virtual] |
Compares two containers.
[in] | lstContainer | Container to compare with |
Implements PLCore::Container< ValueType >.
bool PLCore::Array< ValueType >::operator!= | ( | const Container< ValueType > & | lstContainer | ) | const [override, virtual] |
Compares two containers.
[in] | lstContainer | Container to compare with |
Implements PLCore::Container< ValueType >.
|