30 #ifndef GRT_VECTOR_HEADER
31 #define GRT_VECTOR_HEADER
37 #include "../Util/GRTTypedefs.h"
41 template <
class T>
class Vector :
public std::vector< T >{
53 Vector(
const unsigned int size = 0 ):std::vector< T >(size){}
60 Vector(
const unsigned int size,
const T &value ):std::vector< T >(size, value){}
71 std::copy( rhs.begin(), rhs.end(), this->begin() );
80 Vector(
const std::vector< T > &rhs ){
81 UINT N = (UINT)rhs.size();
84 std::copy( rhs.begin(), rhs.end(), this->begin() );
104 std::copy( rhs.begin(), rhs.end(), this->begin() );
121 std::copy( rhs.begin(), rhs.end(), this->begin() );
133 virtual bool resize(
const unsigned int size ){
134 std::vector< T >::resize( size );
145 virtual bool resize(
const unsigned int size,
const T& value ){
146 std::vector< T >::resize( size, value );
162 std::copy( rhs.begin(), rhs.end(), this->begin() );
177 const size_t N = this->size();
179 if( N == 0 )
return false;
181 T *data = &(*this)[0];
182 for(
size_t i=0; i<N; i++)
193 inline unsigned int getSize()
const{
return (
unsigned int)this->size(); }
201 if( this->size() == 0 )
return NULL;
211 if( this->size() == 0 )
return NULL;
221 #endif //GRT_VECTOR_HEADER
bool setAll(const T &value)
virtual bool resize(const unsigned int size)
unsigned int getSize() const
Vector(const std::vector< T > &rhs)
Vector & operator=(const std::vector< T > &rhs)
const T * getData() const
Vector & operator=(const Vector &rhs)
Vector(const unsigned int size, const T &value)
Vector(const Vector &rhs)
virtual bool resize(const unsigned int size, const T &value)
Vector(const unsigned int size=0)
virtual bool copy(const Vector< T > &rhs)