Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MEDCoupling::MemArray< T > Class Template Reference
Inheritance diagram for MEDCoupling::MemArray< T >:

Public Types

typedef void(* Deallocator )(void *, void *)
 

Public Member Functions

void alloc (std::size_t nbOfElements)
 
void destroy ()
 
void fillWithValue (const T &val)
 
T * fromNoInterlace (int nbOfComp) const
 
const T * getConstPointer () const
 
const T * getConstPointerLoc (std::size_t offset) const
 
Deallocator getDeallocator () const
 
std::size_t getNbOfElem () const
 
std::size_t getNbOfElemAllocated () const
 
void * getParameterForDeallocator () const
 
T * getPointer ()
 
template<class InputIterator >
void insertAtTheEnd (InputIterator first, InputIterator last)
 
bool isDeallocatorCalled () const
 
bool isEqual (const MemArray< T > &other, T prec, std::string &reason) const
 
bool isNull () const
 
 MemArray ()
 
 MemArray (const MemArray< T > &other)
 
MemArray< T > & operator= (const MemArray< T > &other)
 
operator[] (std::size_t id) const
 
T & operator[] (std::size_t id)
 
void pack () const
 
popBack ()
 
void pushBack (T elem)
 
void reAlloc (std::size_t newNbOfElements)
 
void repr (int sl, std::ostream &stream) const
 
bool reprHeader (int sl, std::ostream &stream) const
 
void reprNotTooLong (int sl, std::ostream &stream) const
 
void reprZip (int sl, std::ostream &stream) const
 
void reserve (std::size_t newNbOfElements)
 
void reverse (int nbOfComp)
 
void setParameterForDeallocator (void *param)
 
void setSpecificDeallocator (Deallocator dealloc)
 
void sort (bool asc)
 
T * toNoInterlace (int nbOfComp) const
 
void useArray (const T *array, bool ownership, DeallocType type, std::size_t nbOfElem)
 
void useExternalArrayWithRWAccess (const T *array, std::size_t nbOfElem)
 
void writeOnPlace (std::size_t id, T element0, const T *others, std::size_t sizeOfOthers)
 
 ~MemArray ()
 

Static Public Member Functions

static void CDeallocator (void *pt, void *param)
 
static void CPPDeallocator (void *pt, void *param)
 

Member Typedef Documentation

template<class T>
typedef void(* MEDCoupling::MemArray< T >::Deallocator)(void *, void *)

Constructor & Destructor Documentation

template<class T>
MEDCoupling::MemArray< T >::MemArray ( )
template<class T>
MEDCoupling::MemArray< T >::MemArray ( const MemArray< T > &  other)
template<class T>
MEDCoupling::MemArray< T >::~MemArray ( )

Member Function Documentation

template<class T>
const T* MEDCoupling::MemArray< T >::getConstPointerLoc ( std::size_t  offset) const
template<class T>
const T* MEDCoupling::MemArray< T >::getConstPointer ( ) const
template<class T>
std::size_t MEDCoupling::MemArray< T >::getNbOfElem ( ) const
template<class T>
std::size_t MEDCoupling::MemArray< T >::getNbOfElemAllocated ( ) const
template<class T>
T* MEDCoupling::MemArray< T >::getPointer ( )
template<class T>
MemArray< T > & MEDCoupling::MemArray< T >::operator= ( const MemArray< T > &  other)
template<class T>
T MEDCoupling::MemArray< T >::operator[] ( std::size_t  id) const
template<class T>
T& MEDCoupling::MemArray< T >::operator[] ( std::size_t  id)
template<class T >
void MEDCoupling::MemArray< T >::repr ( int  sl,
std::ostream &  stream 
) const
Parameters
[in]slis typically the number of components

Referenced by MEDCoupling::DataArrayDouble::reprWithoutNameStream(), and MEDCoupling::DataArrayInt::reprWithoutNameStream().

template<class T >
bool MEDCoupling::MemArray< T >::reprHeader ( int  sl,
std::ostream &  stream 
) const
Parameters
[in]slis typically the number of components
Returns
True if a not null pointer is present, False if not.
template<class T >
void MEDCoupling::MemArray< T >::reprZip ( int  sl,
std::ostream &  stream 
) const
Parameters
[in]slis typically the number of components

Referenced by MEDCoupling::DataArrayDouble::reprZipWithoutNameStream(), and MEDCoupling::DataArrayInt::reprZipWithoutNameStream().

template<class T >
void MEDCoupling::MemArray< T >::reprNotTooLong ( int  sl,
std::ostream &  stream 
) const
template<class T>
void MEDCoupling::MemArray< T >::fillWithValue ( const T &  val)
template<class T >
T * MEDCoupling::MemArray< T >::fromNoInterlace ( int  nbOfComp) const
template<class T >
T * MEDCoupling::MemArray< T >::toNoInterlace ( int  nbOfComp) const
template<class T >
void MEDCoupling::MemArray< T >::sort ( bool  asc)
template<class T >
void MEDCoupling::MemArray< T >::reverse ( int  nbOfComp)
template<class T >
void MEDCoupling::MemArray< T >::alloc ( std::size_t  nbOfElements)
template<class T >
void MEDCoupling::MemArray< T >::reserve ( std::size_t  newNbOfElements)

This method performs systematically an allocation of newNbOfElements elements in this. _nb_of_elem and _nb_of_elem_alloc will NOT be systematically equal (contrary to MemArray<T>::reAlloc method. So after the call of this method _nb_of_elem will be equal tostd::min<std::size_t>(_nb_of_elem,newNbOfElements) and _nb_of_elem_alloc equal to newNbOfElements. This method is typically used to perform a pushBack to avoid systematic allocations-copy-deallocation. So after the call of this method the accessible content is perfectly set.

So this method should not be confused with MemArray<T>::reserve that is close to MemArray<T>::reAlloc but not same.

template<class T >
void MEDCoupling::MemArray< T >::reAlloc ( std::size_t  newNbOfElements)

This method performs systematically an allocation of newNbOfElements elements in this. _nb_of_elem and _nb_of_elem_alloc will be equal even if only std::min<std::size_t>(_nb_of_elem,newNbOfElements) come from the . The remaing part of the new allocated chunk are available but not set previouly !

So this method should not be confused with MemArray<T>::reserve that is close to MemArray<T>::reAlloc but not same.

template<class T>
void MEDCoupling::MemArray< T >::useArray ( const T *  array,
bool  ownership,
DeallocType  type,
std::size_t  nbOfElem 
)
template<class T>
void MEDCoupling::MemArray< T >::useExternalArrayWithRWAccess ( const T *  array,
std::size_t  nbOfElem 
)
template<class T>
void MEDCoupling::MemArray< T >::writeOnPlace ( std::size_t  id,
element0,
const T *  others,
std::size_t  sizeOfOthers 
)
template<class T >
template<class InputIterator >
void MEDCoupling::MemArray< T >::insertAtTheEnd ( InputIterator  first,
InputIterator  last 
)
template<class T>
void MEDCoupling::MemArray< T >::pushBack ( elem)
template<class T >
T MEDCoupling::MemArray< T >::popBack ( )
template<class T >
void MEDCoupling::MemArray< T >::pack ( ) const
template<class T>
bool MEDCoupling::MemArray< T >::isDeallocatorCalled ( ) const
template<class T>
Deallocator MEDCoupling::MemArray< T >::getDeallocator ( ) const
template<class T>
void MEDCoupling::MemArray< T >::setSpecificDeallocator ( Deallocator  dealloc)
template<class T>
void MEDCoupling::MemArray< T >::setParameterForDeallocator ( void *  param)
template<class T>
void* MEDCoupling::MemArray< T >::getParameterForDeallocator ( ) const
template<class T >
void MEDCoupling::MemArray< T >::destroy ( )
template<class T >
void MEDCoupling::MemArray< T >::CPPDeallocator ( void *  pt,
void *  param 
)
static
template<class T >
void MEDCoupling::MemArray< T >::CDeallocator ( void *  pt,
void *  param 
)
static