LevelS C++ support library  3.83
Public Member Functions | List of all members
arr< T > Class Template Reference

#include <arr.h>

Inheritance diagram for arr< T >:
arrT< T, normalAlloc__< T > > arr_ref< T >

Public Member Functions

 arr ()
 
 arr (tsize sz)
 
 arr (tsize sz, const T &inival)
 
 arr (T *ptr, tsize sz)
 
 arr (const arr &orig)
 
- Public Member Functions inherited from arrT< T, normalAlloc__< T > >
 arrT ()
 
 arrT (tsize sz)
 
 arrT (tsize sz, const T &inival)
 
 arrT (T *ptr, tsize sz)
 
 arrT (const arrT &orig)
 
 ~arrT ()
 
void alloc (tsize sz)
 
void allocAndFill (tsize sz, const T &inival)
 
void dealloc ()
 
void resize (tsize sz)
 
arrToperator= (const arrT &orig)
 
void copyFrom (const std::vector< T2 > &orig)
 
void copyTo (std::vector< T2 > &vec) const
 
void copyFromPtr (const T2 *ptr, tsize sz)
 
void transfer (arrT &other)
 
void swap (arrT &other)
 
- Public Member Functions inherited from arr_ref< T >
 arr_ref (T *d_, tsize s_)
 
tsize size () const
 
void fill (const T &val)
 
template<typename T2 >
T & operator[] (T2 n)
 
template<typename T2 >
const T & operator[] (T2 n) const
 
T * begin ()
 
T * end ()
 
const T * begin () const
 
const T * end () const
 
template<typename T2 >
void copyToPtr (T *ptr) const
 
void sort ()
 
template<typename Comp >
void sort (Comp comp)
 
void interpol_helper (const T &val, tsize &idx, double &frac) const
 
template<typename Comp >
void interpol_helper (const T &val, Comp comp, tsize &idx, double &frac) const
 
void minmax (T &minv, T &maxv) const
 
bool contains (const T &val) const
 
tsize find (const T &val) const
 
bool contentsEqual (const arr_ref &other) const
 

Detailed Description

template<typename T>
class arr< T >

One-dimensional array type.

Definition at line 300 of file arr.h.

Constructor & Destructor Documentation

◆ arr() [1/5]

template<typename T>
arr< T >::arr ( )
inline

Creates a zero-sized array.

Definition at line 304 of file arr.h.

◆ arr() [2/5]

template<typename T>
arr< T >::arr ( tsize  sz)
inlineexplicit

Creates an array with sz entries.

Definition at line 306 of file arr.h.

◆ arr() [3/5]

template<typename T>
arr< T >::arr ( tsize  sz,
const T &  inival 
)
inline

Creates an array with sz entries, and initializes them with inival.

Definition at line 309 of file arr.h.

◆ arr() [4/5]

template<typename T>
arr< T >::arr ( T *  ptr,
tsize  sz 
)
inline

Creates an array with sz entries, which uses the memory pointed to by ptr.

Note
ptr will not be deallocated by the destructor.
Warning
Only use this if you REALLY know what you are doing. In particular, this is only safely usable if
  • T is a POD type
  • ptr survives during the lifetime of the array object
  • ptr is not subject to garbage collection
Other restrictions may apply. You have been warned.

Definition at line 321 of file arr.h.

◆ arr() [5/5]

template<typename T>
arr< T >::arr ( const arr< T > &  orig)
inline

Creates an array which is a copy of orig. The data in orig is duplicated.

Definition at line 324 of file arr.h.


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

Generated on Wed Nov 13 2024 12:18:16 for LevelS C++ support library