Clarisse 4.0 SP5b SDK  4.0.0.0.5.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | List of all members
CoreVector< T > Class Template Reference
Inheritance diagram for CoreVector< T >:
CoreBasicArray< T > CoreBaseType

Public Types

typedef T value_type
 
typedef CoreBasicArrayIterator< T > const_iterator
 

Public Member Functions

 CoreVector ()
 Empty constructor.
 
 CoreVector (const CoreVector< T > &src)
 Copy constructor.
 
 CoreVector (CoreVector< T > &&src) noexcept
 Move constructor.
 
 CoreVector (std::initializer_list< T > list)
 Initializer list constructor.
 
 CoreVector (const unsigned int &size)
 Constructor with specified initial size.
 
 CoreVector (const unsigned int &size, const unsigned int &capacity)
 Constructor with specified initial size and capacity.
 
 ~CoreVector ()
 Destructor.
 
void append (const T *array, const unsigned int &count)
 appends the specified array
 
void append (const CoreBasicArray< T > &array)
 appends the specified array
 
void append (const CoreBasicArray< T > &array, const unsigned int &start_index, const unsigned int &end_index)
 appends the specified array from start_index to end_index.
 
void append (const T *array, const unsigned int &start_index, const unsigned int &end_index)
 appends the specified array from start_index to end_index.
 
void add (const T &element)
 adds an element to the vector.
 
void add (T &&element)
 adds an rvalue reference'd element to the vector
 
T & add ()
 adds new item, allocated using its default constructor.
 
void insert (const T &element, const unsigned int &index)
 inserts item at specified index.
 
void remove_last ()
 removes last vector item,
 
void empty ()
 empties vector, do not deallocate anything.
 
void remove_all ()
 same as CoreVector::empty
 
void clear ()
 empties the vector, deallocate inner array.
 
void clear (unsigned int new_capacity)
 empties the vector and reallocate inner array to the specified capacity.
 
void remove (const unsigned int &index)
 removes item at specified index.
 
void remove (const unsigned int &index, const bool &preserve_order)
 removes item at specified index.
 
bool is_empty () const
 returns true if vector is empty, false otherwise.
 
bool remove_item (const T &item, const bool &preserve_order)
 removes the first occurence of item from the vector.
 
bool remove_items (const T &item)
 removes all occurences of item from the vector.
 
const unsigned int & get_count () const
 returns the number of items contained in the vector.
 
const unsigned int & get_capacity () const
 returns the allocated size of the vector (may be greater than actual number of items).
 
void set_count (const unsigned int &count)
 set the number of items (allocate memory if needed)
 
void set_capacity (const unsigned int &capacity)
 set the number of items allocatable contigously (clearing all items in the vector)
 
void set_count (const unsigned int &count, const bool &preserve_order)
 set the number of items (allocate memory if needed)
 
bool set_capacity (const unsigned int &capacity, const bool &preserve_items)
 set the number of items allocatable contigously
 
void refit ()
 change vector size to match item count
 
void swap (const unsigned int &swap_v1, const unsigned int &swap_v2)
 swap values at specified indexes
 
void resize (const unsigned int &size)
 change vector size to incoming size - does not preserve items order
 
void resize (const unsigned int &size, const bool &preserve)
 change vector size to incoming size - preserve items order
 
void reserve (const unsigned int &capacity)
 change vector capacity to incoming capacity - does not preserve items
 
bool reserve (const unsigned int &capacity, const bool &preserve_items)
 change vector capacity to incoming capacity - preserve items if specified
 
void copy_from (const CoreBasicArray< T > &src)
 replace vector content with incoming one's
 
void copy_from (const CoreList< T > &src)
 replace vector content with incoming one's
 
void copy_to (CoreVector< T > &dest) const
 copies vector content to incoming one's
 
void get_list (CoreList< T > &list) const
 fills incoming list with vector content
 
void set_list (const CoreList< T > &list)
 sets vector content with incoming list items
 
void get_array (CoreArray< T > &array) const
 fills incoming array with vector content
 
void set_array (const CoreBasicArray< T > &array)
 sets vector content with incoming array items
 
void move (const unsigned int &from, const unsigned int &to)
 moves vector item from an index to another
 
const T & item (const unsigned int &index) const
 returns item at index location
 
T & item (const unsigned int &index)
 
T & operator[] (const unsigned int &index)
 
const T & operator[] (const unsigned int &index) const
 
CoreVectoroperator= (const CoreVector &src)
 Copy assignment.
 
CoreVectoroperator= (CoreVector &&src) noexcept
 Move assignment.
 
const T * get_data () const
 returns internal vector data as item array.
 
size_t get_memory_size () const
 
const CoreClassInfoget_class_info () const
 
- Public Member Functions inherited from CoreBasicArray< T >
 CoreBasicArray ()
 Empty constructor.
 
 CoreBasicArray (T *array, unsigned int count, unsigned int capacity=0)
 Default constructor.
 
 CoreBasicArray (const CoreBasicArray< T > &src)
 Copy constructor.
 
 CoreBasicArray (CoreBasicArray< T > &&src) noexcept
 Move constructor.
 
- Public Member Functions inherited from CoreBaseType
bool is_kindof (const CoreClassInfo &cinfo) const
 
bool operator== (const CoreBaseType &obj) const
 

Static Public Member Functions

static const CoreClassInfoclass_info ()
 
static bool ___class_destructor__ (void *instance, const bool &is_array)
 

Additional Inherited Members

- Static Public Attributes inherited from CoreBasicArray< T >
static constexpr unsigned int INVALID_INDEX = CORE_INVALID_INDEX
 For backward compatibility. Use CORE_INVALID_INDEX instead.
 

Constructor & Destructor Documentation

template<class T>
CoreVector< T >::CoreVector ( const unsigned int &  size)
explicit

Constructor with specified initial size.

Parameters
[in]size,initialyallocated items.
template<class T>
CoreVector< T >::CoreVector ( const unsigned int &  size,
const unsigned int &  capacity 
)

Constructor with specified initial size and capacity.

Parameters
[in]specifiedsize: the actual number of items considered contained by the initial vector
[in]capacity,initialyallocated items (space reserved, but not considered as actual inserted items until they are inserted).

Member Function Documentation

template<class T >
void CoreVector< T >::remove ( const unsigned int &  index,
const bool &  preserve_order 
)

removes item at specified index.

Parameters
[in]preserve_orderif true does not change items order
template<class T>
bool CoreVector< T >::remove_item ( const T &  item,
const bool &  preserve_order 
)

removes the first occurence of item from the vector.

Parameters
[in]preserve_orderif true does not change items order
template<class T >
bool CoreVector< T >::set_capacity ( const unsigned int &  capacity,
const bool &  preserve_items 
)

set the number of items allocatable contigously

Parameters
[in]preserve_itemsif true does not clear vector content
Returns
false if the capacity can't fit items to preserve
template<class T >
void CoreVector< T >::set_count ( const unsigned int &  count,
const bool &  preserve_order 
)

set the number of items (allocate memory if needed)

Parameters
[in]preserve_orderif true does not change items order
template<class T >
void CoreVector< T >::swap ( const unsigned int &  swap_v1,
const unsigned int &  swap_v2 
)

swap values at specified indexes

Parameters
[in]swap_v1value at this index will be moved to swap_v2 index
[in]swap_v2value at this index will be moved to swap_v1 index