The blo Library
Loading...
Searching...
No Matches
Public Member Functions | List of all members
blo::Vector< T > Class Template Reference

Vector. More...

#include <Vector.h>

Inheritance diagram for blo::Vector< T >:
blo::Array1D< T >

Public Member Functions

 Vector ()=default
 Default constructor.
 
 Vector (int len)
 Constructs vector of specified size.
 
 Vector (int len, const T &val)
 Constructs vector of specified size and value.
 
 Vector (const T *pSrc, int len)
 Constructs vector that is a copy of specified vector.
 
 Vector (const T *pSrc, int srcStride2, int len)
 Constructs vector that is a copy of specified vector.
 
 Vector (const Vector< T > &rhs)=default
 Copy constructor.
 
 Vector (Vector< T > &&rhs) noexcept=default
 Move constructor.
 
virtual ~Vector ()=default
 Destructor.
 
Vector< T > & operator= (const Vector< T > &rhs)=default
 Copy assignment operator.
 
Vector< T > & operator= (Vector< T > &&rhs) noexcept=default
 Move assignment operator.
 
Vector< T > & operator*= (const T &scalar)
 
Vector< T > & operator/= (const T &scalar)
 
Vector< T > & operator+= (const T &scalar)
 
Vector< T > & operator+= (const Vector< T > &rhs)
 
Vector< T > & operator-= (const T &scalar)
 
Vector< T > & operator-= (const Vector< T > &rhs)
 
- Public Member Functions inherited from blo::Array1D< T >
 Array1D ()=default
 Default constructor.
 
 Array1D (int len)
 Constructs array of specified size.
 
 Array1D (int len, const T &val)
 Constructs array of specified size and value.
 
 Array1D (const T *pSrc, int len)
 Constructs array that is a copy of specified array.
 
 Array1D (const T *pSrc, int srcStride2, int len)
 Constructs array that is a copy of specified array.
 
 Array1D (const Array1D &rhs)
 Copy constructor.
 
 Array1D (Array1D &&rhs) noexcept
 Move constructor.
 
virtual ~Array1D ()
 Destructor.
 
Array1D & operator= (const Array1D &rhs)
 Copy assignment operator.
 
Array1D & operator= (Array1D &&rhs) noexcept
 Move assignment operator.
 
T & operator[] (int index)
 Index array element.
 
const T & operator[] (int index) const
 Index array element.
 
bool empty () const
 Tests if the array is empty.
 
void resize (int len)
 Resizes array.
 
void clear ()
 Resizes array to zero length.
 
int size () const
 Number of elements in the array.
 
int len () const
 Length of the array.
 
T * ptrData ()
 Retrieves the pointer to the beginning of the array.
 
const T * ptrData () const
 Retrieves the pointer to the beginning of the array.
 
void swap (Array1D &rhs)
 Swaps this array with another one.
 
void set (const T &val)
 Sets array elements to a value.
 

Additional Inherited Members

- Static Public Member Functions inherited from blo::Array1D< T >
static int stride2 ()
 Stride in bytes between the elements in the array.
 

Detailed Description

template<typename T>
class blo::Vector< T >

Vector.

Template Parameters
TData type.

Constructor & Destructor Documentation

◆ Vector() [1/7]

template<typename T >
blo::Vector< T >::Vector ( )
default

Default constructor.

◆ Vector() [2/7]

template<typename T >
blo::Vector< T >::Vector ( int  len)
explicit

Constructs vector of specified size.

Parameters
lenVector length.

◆ Vector() [3/7]

template<typename T >
blo::Vector< T >::Vector ( int  len,
const T &  val 
)

Constructs vector of specified size and value.

Parameters
lenVector length.
valConstant value to assign to each element in the vector.

◆ Vector() [4/7]

template<typename T >
blo::Vector< T >::Vector ( const T *  pSrc,
int  len 
)

Constructs vector that is a copy of specified vector.

Parameters
pSrcPointer to the source vector.
lenVector length.

◆ Vector() [5/7]

template<typename T >
blo::Vector< T >::Vector ( const T *  pSrc,
int  srcStride2,
int  len 
)

Constructs vector that is a copy of specified vector.

Parameters
pSrcPointer to the source vector.
srcStride2Stride in bytes between the elements in the source vector.
lenVector length.

◆ Vector() [6/7]

template<typename T >
blo::Vector< T >::Vector ( const Vector< T > &  rhs)
default

Copy constructor.

◆ Vector() [7/7]

template<typename T >
blo::Vector< T >::Vector ( Vector< T > &&  rhs)
defaultnoexcept

Move constructor.

◆ ~Vector()

template<typename T >
virtual blo::Vector< T >::~Vector ( )
virtualdefault

Destructor.

Member Function Documentation

◆ operator*=()

template<typename T >
Vector< T > & blo::Vector< T >::operator*= ( const T &  scalar)

◆ operator+=() [1/2]

template<typename T >
Vector< T > & blo::Vector< T >::operator+= ( const T &  scalar)

◆ operator+=() [2/2]

template<typename T >
Vector< T > & blo::Vector< T >::operator+= ( const Vector< T > &  rhs)

◆ operator-=() [1/2]

template<typename T >
Vector< T > & blo::Vector< T >::operator-= ( const T &  scalar)

◆ operator-=() [2/2]

template<typename T >
Vector< T > & blo::Vector< T >::operator-= ( const Vector< T > &  rhs)

◆ operator/=()

template<typename T >
Vector< T > & blo::Vector< T >::operator/= ( const T &  scalar)

◆ operator=() [1/2]

template<typename T >
Vector< T > & blo::Vector< T >::operator= ( const Vector< T > &  rhs)
default

Copy assignment operator.

◆ operator=() [2/2]

template<typename T >
Vector< T > & blo::Vector< T >::operator= ( Vector< T > &&  rhs)
defaultnoexcept

Move assignment operator.


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