Tizen Native API
|
Base class to handle the memory of simple vector. More...
Public Types | |
typedef std::size_t | SizeType |
Size type. | |
Public Member Functions | |
SizeType | Count () const |
This method is inlined as its needed frequently for Vector::End() iterator. | |
SizeType | Size () const |
Gets the count of elements in this vector. | |
SizeType | Capacity () const |
Gets the capacity of this vector. | |
void | Release () |
Release the data. | |
Protected Member Functions | |
VectorBase () | |
Default constructor. Does not allocate space. | |
~VectorBase () | |
Destructor. | |
void | SetCount (SizeType count) |
Helper to set the count. | |
void | Reserve (SizeType count, SizeType elementSize) |
Reserve space in the vector. | |
void | Copy (const VectorBase &vector, SizeType elementSize) |
Copy a vector. | |
void | Swap (VectorBase &vector) |
Swap the contents of two vectors. | |
void | Erase (char *address, SizeType elementSize) |
Erase an element. | |
char * | Erase (char *first, char *last, SizeType elementSize) |
Erase a range of elements. | |
void | CopyMemory (char *destination, const char *source, size_t numberOfBytes) |
Copies a number of bytes from source to destination. | |
Protected Attributes | |
void * | mData |
Pointer to the data. |
Detailed Description
Base class to handle the memory of simple vector.
Memory layout is such that it has two std::size_t to hold the count and capacity of the vector. VectorBase::mData is adjusted so that it points to the beginning of the first real item so that iterating the items is quick.
- Since :
- 2.4
Member Typedef Documentation
typedef std::size_t Dali::VectorBase::SizeType |
Size type.
- Since :
- 2.4
Reimplemented in Dali::Vector< T, IsTrivialType >, Dali::Vector< SlotConnection * >, Dali::Vector< SignalConnection * >, Dali::VectorAlgorithms< IsTrivial >, Dali::VectorAlgorithms< TypeTraits< SlotConnection * >::IS_TRIVIAL_TYPE==true >, Dali::VectorAlgorithms< IsTrivialType >, and Dali::VectorAlgorithms< TypeTraits< SignalConnection * >::IS_TRIVIAL_TYPE==true >.
Constructor & Destructor Documentation
Dali::VectorBase::VectorBase | ( | ) | [protected] |
Default constructor. Does not allocate space.
- Since :
- 2.4
Dali::VectorBase::~VectorBase | ( | ) | [protected] |
Destructor.
Does not release the space. Derived class needs to call Release. Not virtual as should not be called directly and we do not want a vtable for this class as it would unnecessarily increase size.
- Since :
- 2.4
Member Function Documentation
SizeType Dali::VectorBase::Capacity | ( | ) | const |
Gets the capacity of this vector.
- Since :
- 2.4
- Returns:
- The capacity of this vector.
void Dali::VectorBase::Copy | ( | const VectorBase & | vector, |
SizeType | elementSize | ||
) | [protected] |
Copy a vector.
- Since :
- 2.4
- Parameters:
-
[in] vector Vector to copy from. [in] elementSize Size of a single element.
Reimplemented in Dali::VectorAlgorithms< IsTrivial >, Dali::VectorAlgorithms< TypeTraits< SlotConnection * >::IS_TRIVIAL_TYPE==true >, Dali::VectorAlgorithms< IsTrivialType >, and Dali::VectorAlgorithms< TypeTraits< SignalConnection * >::IS_TRIVIAL_TYPE==true >.
void Dali::VectorBase::CopyMemory | ( | char * | destination, |
const char * | source, | ||
size_t | numberOfBytes | ||
) | [protected] |
Copies a number of bytes from source to destination.
source and destination must not overlap.
- Since :
- 2.4
- Parameters:
-
[in] destination Pointer to the destination address. [in] source Pointer to the source address. [in] numberOfBytes The number of bytes to be copied.
SizeType Dali::VectorBase::Count | ( | ) | const |
This method is inlined as its needed frequently for Vector::End() iterator.
- Since :
- 2.4
- Returns:
- The count of elements in this vector.
void Dali::VectorBase::Erase | ( | char * | address, |
SizeType | elementSize | ||
) | [protected] |
Erase an element.
Does not change capacity.
- Since :
- 2.4
- Parameters:
-
[in] address Adress to erase from. [in] elementSize Size to erase.
- Precondition:
- Last element cannot be erased as there is nothing to move.
Reimplemented in Dali::VectorAlgorithms< IsTrivial >, Dali::VectorAlgorithms< TypeTraits< SlotConnection * >::IS_TRIVIAL_TYPE==true >, Dali::VectorAlgorithms< IsTrivialType >, and Dali::VectorAlgorithms< TypeTraits< SignalConnection * >::IS_TRIVIAL_TYPE==true >.
char* Dali::VectorBase::Erase | ( | char * | first, |
char * | last, | ||
SizeType | elementSize | ||
) | [protected] |
Erase a range of elements.
Does not change capacity.
- Since :
- 2.4
- Parameters:
-
[in] first Address to the first element to be erased. [in] last Address to the last element to be erased. [in] elementSize Size of one of the elements to be erased.
- Returns:
- Address pointing to the next element of the last one.
Reimplemented in Dali::VectorAlgorithms< IsTrivial >, Dali::VectorAlgorithms< TypeTraits< SlotConnection * >::IS_TRIVIAL_TYPE==true >, Dali::VectorAlgorithms< IsTrivialType >, and Dali::VectorAlgorithms< TypeTraits< SignalConnection * >::IS_TRIVIAL_TYPE==true >.
void Dali::VectorBase::Release | ( | ) |
Release the data.
Does not call destructors on objects held.
- Since :
- 2.4
Reimplemented in Dali::Vector< T, IsTrivialType >, Dali::Vector< SlotConnection * >, Dali::Vector< SignalConnection * >, Dali::VectorAlgorithms< IsTrivial >, Dali::VectorAlgorithms< TypeTraits< SlotConnection * >::IS_TRIVIAL_TYPE==true >, Dali::VectorAlgorithms< IsTrivialType >, and Dali::VectorAlgorithms< TypeTraits< SignalConnection * >::IS_TRIVIAL_TYPE==true >.
void Dali::VectorBase::Reserve | ( | SizeType | count, |
SizeType | elementSize | ||
) | [protected] |
Reserve space in the vector.
- Since :
- 2.4
- Parameters:
-
[in] count Count of elements to reserve. [in] elementSize Size of a single element.
Reimplemented in Dali::VectorAlgorithms< IsTrivial >, Dali::VectorAlgorithms< TypeTraits< SlotConnection * >::IS_TRIVIAL_TYPE==true >, Dali::VectorAlgorithms< IsTrivialType >, and Dali::VectorAlgorithms< TypeTraits< SignalConnection * >::IS_TRIVIAL_TYPE==true >.
void Dali::VectorBase::SetCount | ( | SizeType | count | ) | [protected] |
Helper to set the count.
- Since :
- 2.4
- Parameters:
-
[in] count Number of elements in the vector.
SizeType Dali::VectorBase::Size | ( | ) | const |
Gets the count of elements in this vector.
- Since :
- 2.4
- Returns:
- The count of elements in this vector.
void Dali::VectorBase::Swap | ( | VectorBase & | vector | ) | [protected] |