Catos Engine (Source) 0.0.1
Lightweight Game engine
Loading...
Searching...
No Matches
catos::vector< T > Class Template Reference

#include <vector.h>

Classes

class  iterator
 

Public Member Functions

 vector ()
 Initializes the vector to empty.
 
 vector (const vector &obj)
 Copy Constructor.
 
 vector (vector &&obj)
 Move Constructor.
 
template<typename ... Args>
 vector (Args &&...args)
 Initializes and calls push_back for all elements given.
 
vector< T > & operator= (const vector< T > &obj)
 Copies the obj.
 
void reserve (unsigned int amount)
 allocates enough memory for the amount given.
 
void resize (unsigned int newSize)
 
void push_back (T obj)
 Adds the new item to the array.
 
void clear ()
 clears the buffer
 
void remove (int index)
 removes the item at the index
 
T & at (int index)
 returns the item at the desired index.
 
T & back ()
 gives the last item.
 
void pop_back ()
 Removes the last item.
 
T * data ()
 gives the internal buffer
 
unsigned int length ()
 returns the amount of objects in the internal buffer.
 
bool empty ()
 Returns if the size is <= 0.
 
unsigned int maxLength ()
 returns the maximum amount of objects in our internal buffer
 
T & operator[] (int i)
 Returns the obj for the given index.
 
 ~vector ()
 Deletes the allocated objects.
 
iterator begin ()
 
iterator begin () const
 
iterator end ()
 
iterator end () const
 
iterator cbegin () const
 
iterator cend () const
 

Constructor & Destructor Documentation

◆ vector() [1/4]

template<typename T >
catos::vector< T >::vector ( )
inline

Initializes the vector to empty.

◆ vector() [2/4]

template<typename T >
catos::vector< T >::vector ( const vector< T > & obj)
inline

Copy Constructor.

◆ vector() [3/4]

template<typename T >
catos::vector< T >::vector ( vector< T > && obj)
inline

Move Constructor.

◆ vector() [4/4]

template<typename T >
template<typename ... Args>
catos::vector< T >::vector ( Args &&... args)
inline

Initializes and calls push_back for all elements given.

◆ ~vector()

template<typename T >
catos::vector< T >::~vector ( )
inline

Deletes the allocated objects.

Member Function Documentation

◆ at()

template<typename T >
T & catos::vector< T >::at ( int index)
inline

returns the item at the desired index.

◆ back()

template<typename T >
T & catos::vector< T >::back ( )
inline

gives the last item.

◆ begin() [1/2]

template<class T >
vector< T >::iterator catos::vector< T >::begin ( )
inline

◆ begin() [2/2]

template<class T >
vector< T >::iterator catos::vector< T >::begin ( ) const
inline

◆ cbegin()

template<class T >
vector< T >::iterator catos::vector< T >::cbegin ( ) const
inline

◆ cend()

template<class T >
vector< T >::iterator catos::vector< T >::cend ( ) const
inline

◆ clear()

template<typename T >
void catos::vector< T >::clear ( )
inline

clears the buffer

◆ data()

template<typename T >
T * catos::vector< T >::data ( )
inline

gives the internal buffer

◆ empty()

template<typename T >
bool catos::vector< T >::empty ( )
inline

Returns if the size is <= 0.

◆ end() [1/2]

template<class T >
vector< T >::iterator catos::vector< T >::end ( )
inline

◆ end() [2/2]

template<class T >
vector< T >::iterator catos::vector< T >::end ( ) const
inline

◆ length()

template<typename T >
unsigned int catos::vector< T >::length ( )
inline

returns the amount of objects in the internal buffer.

◆ maxLength()

template<typename T >
unsigned int catos::vector< T >::maxLength ( )
inline

returns the maximum amount of objects in our internal buffer

◆ operator=()

template<typename T >
vector< T > & catos::vector< T >::operator= ( const vector< T > & obj)
inline

Copies the obj.

◆ operator[]()

template<typename T >
T & catos::vector< T >::operator[] ( int i)
inline

Returns the obj for the given index.

◆ pop_back()

template<typename T >
void catos::vector< T >::pop_back ( )
inline

Removes the last item.

◆ push_back()

template<typename T >
void catos::vector< T >::push_back ( T obj)
inline

Adds the new item to the array.

◆ remove()

template<typename T >
void catos::vector< T >::remove ( int index)
inline

removes the item at the index

◆ reserve()

template<typename T >
void catos::vector< T >::reserve ( unsigned int amount)
inline

allocates enough memory for the amount given.

◆ resize()

template<typename T >
void catos::vector< T >::resize ( unsigned int newSize)
inline

The documentation for this class was generated from the following file: