VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
CbVector< T > Class Template Reference

A class implements a container like a vector. More...

#include <CbVector.h>

Public Types

using value_type = T
 
using pointer = value_type *
 
using size_type = std::size_t
 

Public Member Functions

 CbVector (const CbVector< value_type > &src)=delete
 
 CbVector (CbVectorAllocator< value_type > *const &allocator=new CbVectorAllocatorStd< value_type >)
 
 CbVector (const size_type size, CbVectorAllocator< value_type > *const &allocator=new CbVectorAllocatorStd< value_type >, const value_type &value=value_type())
 
virtual ~CbVector ()
 
CbVector & operator= (const CbVector &src)
 
CbVector & operator= (const std::vector< value_type > &src)
 
bool operator== (const CbVector &rhs) const
 
void setAllocator (CbVectorAllocator< value_type > *const &allocator)
 
size_type size () const
 
bool empty () const
 
bool resize (const size_type &dataSize)
 
bool resize (const size_type &dataSize, const value_type &value)
 
void swap (CbVector &rhs)
 
value_type & operator[] (const size_type &i)
 
const value_type & operator[] (const size_type &i) const
 
CbVectorAllocator< value_type > * getAllocator () const
 

Friends

class CbVectorAllocator< value_type >
 

Detailed Description

template<typename T>
class CbVector< T >

A class implements a container like a vector.

For this class it was required to ave only the type as template argument. Hence, the allocator must be an abstract class. With out this requirement, an allocator as second template argument would have been possible, as in the STL vector. This would lead to the compiler generating two different classes for the same data type with different allocators during compile time. Here it is required that the same class can have different allocators.

Rangecheck active, if: -debug : not defined "VF_NO_RANGECHECK" -release: not defined "VF_NO_RANGECHECK" && defined "VF_RANGECHECK"

Definition at line 66 of file CbVector.h.

Member Typedef Documentation

◆ pointer

template<typename T >
using CbVector< T >::pointer = value_type *

Definition at line 70 of file CbVector.h.

◆ size_type

template<typename T >
using CbVector< T >::size_type = std::size_t

Definition at line 71 of file CbVector.h.

◆ value_type

template<typename T >
using CbVector< T >::value_type = T

Definition at line 69 of file CbVector.h.

Constructor & Destructor Documentation

◆ CbVector() [1/3]

template<typename T >
CbVector< T >::CbVector ( const CbVector< value_type > &  src)
delete

◆ CbVector() [2/3]

Definition at line 79 of file CbVector.h.

◆ CbVector() [3/3]

template<typename T >
CbVector< T >::CbVector ( const size_type  size,
CbVectorAllocator< value_type > *const &  allocator = new CbVectorAllocatorStd<value_type>,
const value_type &  value = value_type() 
)
inline

Definition at line 85 of file CbVector.h.

◆ ~CbVector()

template<typename T >
virtual CbVector< T >::~CbVector ( )
inlinevirtual

Definition at line 93 of file CbVector.h.

Member Function Documentation

◆ empty()

template<typename T >
bool CbVector< T >::empty ( ) const
inline

Definition at line 165 of file CbVector.h.

◆ getAllocator()

template<typename T >
CbVectorAllocator< value_type > * CbVector< T >::getAllocator ( ) const
inline

Definition at line 206 of file CbVector.h.

◆ operator=() [1/2]

template<typename T >
CbVector & CbVector< T >::operator= ( const CbVector< T > &  src)
inline

Definition at line 102 of file CbVector.h.

◆ operator=() [2/2]

template<typename T >
CbVector & CbVector< T >::operator= ( const std::vector< value_type > &  src)
inline

Definition at line 121 of file CbVector.h.

◆ operator==()

template<typename T >
bool CbVector< T >::operator== ( const CbVector< T > &  rhs) const
inline

Definition at line 137 of file CbVector.h.

◆ operator[]() [1/2]

template<typename T >
value_type & CbVector< T >::operator[] ( const size_type &  i)
inline

Definition at line 184 of file CbVector.h.

◆ operator[]() [2/2]

template<typename T >
const value_type & CbVector< T >::operator[] ( const size_type &  i) const
inline

Definition at line 195 of file CbVector.h.

◆ resize() [1/2]

template<typename T >
bool CbVector< T >::resize ( const size_type &  dataSize)
inline

Definition at line 167 of file CbVector.h.

◆ resize() [2/2]

template<typename T >
bool CbVector< T >::resize ( const size_type &  dataSize,
const value_type &  value 
)
inline

Definition at line 169 of file CbVector.h.

◆ setAllocator()

template<typename T >
void CbVector< T >::setAllocator ( CbVectorAllocator< value_type > *const &  allocator)
inline

Definition at line 151 of file CbVector.h.

◆ size()

template<typename T >
size_type CbVector< T >::size ( ) const
inline

Definition at line 163 of file CbVector.h.

◆ swap()

template<typename T >
void CbVector< T >::swap ( CbVector< T > &  rhs)
inline

Definition at line 174 of file CbVector.h.

Friends And Related Symbol Documentation

◆ CbVectorAllocator< value_type >

Definition at line 1 of file CbVector.h.


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