Metafunction for generation of a flattened vector of vectors. More...
#include <flatVector2D.hpp>
Friends | |
template<class U > | |
OBinaryStream & | operator<<) (OBinaryStream &buffer, const FlatVector2D< U > &vector) |
template<class U > | |
IBinaryStream & | operator>>) (IBinaryStream &buffer, FlatVector2D< U > &vector) |
Metafunction for generation of a flattened vector of vectors.
Usage: Use FlatVector2D<Type>
to declare a flattened vector of vectors.
T | The type of the objects stored in the vector |
Definition at line 59 of file flatVector2D.hpp.
Default constructor.
Definition at line 75 of file flatVector2D.tpp.
bitpit::FlatVector2D< T >::FlatVector2D | ( | const std::vector< std::size_t > & | sizes, |
const T & | value = T() ) |
Creates a new container.
sizes | are the sizes of the vectors |
value | is the value that will be use to initialize the items of the vectors |
Definition at line 88 of file flatVector2D.tpp.
bitpit::FlatVector2D< T >::FlatVector2D | ( | std::size_t | nVectors, |
std::size_t | size, | ||
const T & | value = T() ) |
Creates a new container.
nVectors | is the number of vectors |
size | is the size of the vectors |
value | is the value that will be use to initialize the items of the vectors |
Definition at line 102 of file flatVector2D.tpp.
bitpit::FlatVector2D< T >::FlatVector2D | ( | std::size_t | nVectors, |
const std::size_t * | sizes, | ||
const T & | value ) |
Creates a new container.
nVectors | is the number of vectors |
sizes | are the sizes of the vectors |
value | is the value that will be use to initialize the items of the vectors |
Definition at line 116 of file flatVector2D.tpp.
bitpit::FlatVector2D< T >::FlatVector2D | ( | std::size_t | nVectors, |
const std::size_t * | sizes, | ||
const T * | values ) |
Creates a new container.
nVectors | is the number of vectors |
sizes | are the sizes of the vectors |
values | are the values of the vectors |
Definition at line 129 of file flatVector2D.tpp.
bitpit::FlatVector2D< T >::FlatVector2D | ( | const std::vector< std::vector< T > > & | vector2D | ) |
Creates a new container.
vector2D | is a 2D vector that will be used to initialize the newly created container |
Definition at line 141 of file flatVector2D.tpp.
T * bitpit::FlatVector2D< T >::back | ( | ) |
Gets a pointer to the first item of the last vector.
Definition at line 956 of file flatVector2D.tpp.
std::size_t bitpit::FlatVector2D< T >::capacity | ( | ) | const |
Returns the size of the storage space currently allocated for storing vectors, expressed in terms of items.
Definition at line 995 of file flatVector2D.tpp.
Clears content.
Removes all items from the container (which are destroyed), leaving the container with a size of 0.
release | if it's true the memory hold by the container will be released, otherwise the container will be cleared but its memory will not be relased |
Definition at line 466 of file flatVector2D.tpp.
Clears the items.
Removes all items stored in the vectors (which are destroyed), leaving each vector with a size of 0.
release | if it's true the memory hold by the container will be released, otherwise the container will be cleared but its memory will not be relased |
Definition at line 491 of file flatVector2D.tpp.
Returns a direct constant pointer to the memory vector used internally by the container to store its items.
Definition at line 569 of file flatVector2D.tpp.
|
noexcept |
Returns a direct pointer to the memory vector used internally by the container to store its items.
Definition at line 555 of file flatVector2D.tpp.
void bitpit::FlatVector2D< T >::destroy | ( | ) |
Destroy the container.
After calling this function the container will be non-functional until it is re-initialized.
Definition at line 361 of file flatVector2D.tpp.
bool bitpit::FlatVector2D< T >::empty | ( | ) | const |
Tests whether the container is empty.
Definition at line 450 of file flatVector2D.tpp.
void bitpit::FlatVector2D< T >::erase | ( | std::size_t | i | ) |
Deletes specified vector.
Removes from the container the specified vector, effectively reducing the container size by one.
i | is the index of the vector |
Definition at line 791 of file flatVector2D.tpp.
void bitpit::FlatVector2D< T >::eraseItem | ( | std::size_t | i, |
std::size_t | j ) |
Deletes the specified item from a vector.
i | is the index of the vector |
j | is the index of the item that will be removed |
Definition at line 806 of file flatVector2D.tpp.
Sets the specified value as the value for all the items in the container.
value | is the value to fill the container with |
Definition at line 428 of file flatVector2D.tpp.
T * bitpit::FlatVector2D< T >::first | ( | ) |
Gets a pointer to the first item of the first vector.
Definition at line 967 of file flatVector2D.tpp.
T * bitpit::FlatVector2D< T >::get | ( | std::size_t | i | ) |
Gets a pointer to the first item of the specified vector.
i | is the index of the vector |
Definition at line 895 of file flatVector2D.tpp.
Gets a constant pointer to the first item of the specified vector.
i | is the index of the vector |
Definition at line 881 of file flatVector2D.tpp.
size_t bitpit::FlatVector2D< T >::getBinarySize | ( | ) | const |
Returns the buffer size (in bytes) required to store the container.
Definition at line 1068 of file flatVector2D.tpp.
T & bitpit::FlatVector2D< T >::getItem | ( | std::size_t | i, |
std::size_t | j ) |
Gets a reference of the specified item in a vector.
i | is the index of the vector |
j | is the index of the item that will be removed |
Definition at line 854 of file flatVector2D.tpp.
const T & bitpit::FlatVector2D< T >::getItem | ( | std::size_t | i, |
std::size_t | j ) const |
Gets a constant reference of the specified item in a vector.
i | is the index of the vector |
j | is the index of the item that will be removed |
Definition at line 868 of file flatVector2D.tpp.
std::size_t bitpit::FlatVector2D< T >::getItemCapacity | ( | ) | const |
Returns the size of the storage space currently allocated for storing vectors items, expressed in terms of items.
Definition at line 1057 of file flatVector2D.tpp.
std::size_t bitpit::FlatVector2D< T >::getItemCount | ( | ) | const |
Returns the total size of all the vectors.
Definition at line 1024 of file flatVector2D.tpp.
std::size_t bitpit::FlatVector2D< T >::getItemCount | ( | std::size_t | i | ) | const |
Returns the size of the specified vector.
i | is the index of the vector |
Definition at line 1040 of file flatVector2D.tpp.
|
noexcept |
Returns a constant pointer to the first item in the vector used internally by the container to store the indices.
Definition at line 525 of file flatVector2D.tpp.
|
noexcept |
Returns a constant pointer to the first item in the vector used internally by the container to store the indices of the specified vector.
i | is the index of the vector |
Definition at line 541 of file flatVector2D.tpp.
void bitpit::FlatVector2D< T >::initialize | ( | const FlatVector2D< T > & | other | ) |
Initializes the container.
other | is antoher container of the same type, whose contents will be used to initialize the current container |
Definition at line 348 of file flatVector2D.tpp.
void bitpit::FlatVector2D< T >::initialize | ( | const std::vector< std::size_t > & | sizes, |
const T & | value = T() ) |
Initializes the container.
sizes | are the sizes of the vectors |
value | is the value that will be use to initialize the items of the vectors |
Definition at line 165 of file flatVector2D.tpp.
void bitpit::FlatVector2D< T >::initialize | ( | const std::vector< std::vector< T > > & | vector2D | ) |
Initializes the container.
vector2D | is a 2D vector that will be used to initialize the container |
Definition at line 290 of file flatVector2D.tpp.
void bitpit::FlatVector2D< T >::initialize | ( | std::size_t | nVectors, |
const std::size_t * | sizes, | ||
const T & | value ) |
Initializes the container.
nVectors | is the number of vectors |
sizes | are the sizes of the vectors |
value | is the value that will be use to initialize the items of the vectors |
Definition at line 193 of file flatVector2D.tpp.
void bitpit::FlatVector2D< T >::initialize | ( | std::size_t | nVectors, |
const std::size_t * | sizes, | ||
const T * | values ) |
Initializes the container.
nVectors | is the number of vectors |
sizes | are the sizes of the vectors |
values | are the values of the vectors |
Definition at line 207 of file flatVector2D.tpp.
void bitpit::FlatVector2D< T >::initialize | ( | std::size_t | nVectors, |
std::size_t | size, | ||
const T & | value = T() ) |
Initializes the container.
nVectors | is the number of vectors |
size | is the size of the vectors |
value | is the value that will be use to initialize the items of the vectors |
Definition at line 179 of file flatVector2D.tpp.
bool bitpit::FlatVector2D< T >::isInitialized | ( | ) | const |
Check if the container has been initialized.
Definition at line 152 of file flatVector2D.tpp.
void bitpit::FlatVector2D< T >::merge | ( | ) |
Merge the arrays together.
Definition at line 1008 of file flatVector2D.tpp.
|
default |
Copy assignment operator.
Assigns new contents to the container, replacing its current contents, and modifying its size accordingly.
|
default |
Move assignment operator.
The move assignment operator "steals" the resources held by the argument.
bool bitpit::FlatVector2D< T >::operator== | ( | const FlatVector2D< T > & | rhs | ) | const |
Tests whether two containers are equal.
Definition at line 439 of file flatVector2D.tpp.
void bitpit::FlatVector2D< T >::popBack | ( | ) |
Deletes last vector.
Removes the last vector in the container, effectively reducing the container size by one.
Definition at line 732 of file flatVector2D.tpp.
void bitpit::FlatVector2D< T >::popBackItem | ( | ) |
Deletes last item from last vector.
Removes the last item from the last vector in the container.
Definition at line 748 of file flatVector2D.tpp.
void bitpit::FlatVector2D< T >::popBackItem | ( | std::size_t | i | ) |
Deletes last item from specified vector.
Removes the last item from the specified vector in the container.
i | is the index of the vector |
Definition at line 766 of file flatVector2D.tpp.
void bitpit::FlatVector2D< T >::pushBack | ( | ) |
Adds an empty vector at the end.
Adds an empty vector at the end of the container, after its current last vector.
Definition at line 595 of file flatVector2D.tpp.
Adds the specified vector at the end.
Adds the specified vector at the end of the vector, after its current last item.
subArray | is the vector that will be added |
Definition at line 629 of file flatVector2D.tpp.
Adds a vector with the specified size at the end.
Adds a vector with the specified size at the end of the vector, after its current last item. The content of value is copied (or moved) to the new vector.
subArraySize | is the size of the vector |
value | is the value to be copied (or moved) to the new item |
Definition at line 612 of file flatVector2D.tpp.
void bitpit::FlatVector2D< T >::pushBack | ( | std::size_t | subArraySize, |
const T * | subArray ) |
Adds the specified array at the end.
Adds the specified array at the end of the vector, after its current last item.
subArraySize | is the size of the sub array |
subArray | is a pointer to the sub array will be added |
Definition at line 644 of file flatVector2D.tpp.
Adds an item to the last vector.
Adds an item at the end of to the last vector.
value | is the value that will be added |
Definition at line 660 of file flatVector2D.tpp.
Adds an item to the specified vector.
Adds an item at the end of to the specified last vector.
i | is the index of the vector |
value | is the value that will be added |
Definition at line 691 of file flatVector2D.tpp.
Adds an item to the specified vector.
Adds an item at the end of to the specified last vector.
i | is the index of the vector |
value | is the value that will be added |
Definition at line 713 of file flatVector2D.tpp.
Adds an item to the last vector.
Adds an item at the end of to the last vector.
value | is the value that will be added |
Definition at line 675 of file flatVector2D.tpp.
T & bitpit::FlatVector2D< T >::rawGetItem | ( | std::size_t | k | ) |
Gets a reference of the specified item in a vector.
k | is the raw index |
Definition at line 933 of file flatVector2D.tpp.
Gets a constant reference of the specified item in a vector.
k | is the raw index |
Definition at line 945 of file flatVector2D.tpp.
Sets the value of the specified item in a vector.
k | is the raw index |
value | is the value that will be set |
Definition at line 909 of file flatVector2D.tpp.
Sets the value of the specified item in a vector.
k | is the raw index |
value | is the value that will be set |
Definition at line 921 of file flatVector2D.tpp.
void bitpit::FlatVector2D< T >::reserve | ( | std::size_t | nVectors, |
std::size_t | nItems = 0 ) |
Requests a change in capacity.
Requests that the collpased-vector capacity be at least enough to contain nVectors vectors and nItems items.
nVectors | is the minimum number of vectors that the container should be able to contain |
nItems | is the minimum number of items that the container should be able to contain |
Definition at line 401 of file flatVector2D.tpp.
void bitpit::FlatVector2D< T >::setItem | ( | std::size_t | i, |
std::size_t | j, | ||
const T & | value ) |
Sets the value of the specified item in a vector.
i | is the index of the vector |
j | is the index of the item that will be removed |
value | is the value that will be set |
Definition at line 826 of file flatVector2D.tpp.
void bitpit::FlatVector2D< T >::setItem | ( | std::size_t | i, |
std::size_t | j, | ||
T && | value ) |
Sets the value of the specified item in a vector.
i | is the index of the vector |
j | is the index of the item that will be removed |
value | is the value that will be set |
Definition at line 840 of file flatVector2D.tpp.
void bitpit::FlatVector2D< T >::shrinkToFit | ( | ) |
Shrinks to fit
Requests the container to reduce its capacity to fit its size.
Definition at line 511 of file flatVector2D.tpp.
std::size_t bitpit::FlatVector2D< T >::size | ( | ) | const |
Returns the number of vectors in the container
Definition at line 978 of file flatVector2D.tpp.
|
noexcept |
Swaps the contents.
other | is another container of the same type |
Definition at line 415 of file flatVector2D.tpp.
const std::vector< T > & bitpit::FlatVector2D< T >::vector | ( | ) | const |
Returns a constant reference to the vector used internally by the container to store its items.
Definition at line 583 of file flatVector2D.tpp.