MIDAS  0.75
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
List of all members
midaspace::GPA< T > Class Template Reference

GPA - Generic Pointer Array, template class manages 1d array of pointers to objects of type T. More...

#include <gpa.h>

GENERAL

long size
 
long asize
 
long dsize
 
T ** values
 
 GPA (void)
 CONSTRUCTOR. More...
 
 GPA (long s, long ds=1)
 CONSTRUCTOR. More...
 
 GPA (const GPA< T > *src)
 CONSTRUCTOR COPY. More...
 
 ~GPA ()
 DESTRUCTOR. More...
 

RE/DE/ALLOCATION

void realloc_core (long new_asize)
 reallocate up receiver without checking of sizes More...
 
void free_ptrs_core (long newsize)
 reallocate down (free pointers) receiver without checking of sizes More...
 
void realloc (long new_asize)
 reallocate up receiver with checking the new size More...
 
void reallocup (long new_asize)
 reallocate up receiver with checking the new size More...
 
void reallocdown (long new_asize)
 reallocate up receiver with checking the new size More...
 
void reallocplus (long d)
 reallocate receiver to the new size More...
 
void resize (long newsize)
 reallocate receiver to the new size More...
 
void resizeup (long newsize)
 
void resizedown (long newsize)
 
void resize_zero (void)
 

SET

void free_ptrs (void)
 
void free_ptr (T *val)
 
void free_ptr (long i)
 
void delete_object (long i)
 Delete object pointed by the i-th pointer. The pointer is set to NULL. More...
 
void delete_objects (void)
 Delete all objects pointed by pointers. The pointers are set to NULL. More...
 
void initialize (long s, long ds=0)
 
void be_copy_of (const GPA< T > *src)
 
void reverse ()
 
void assign (long i, T *val)
 
T * add (T *val)
 add (assign) new pointer to the end; enlarge the receiver if too small More...
 
T * wedge (long i, T *val)
 
void add_unique (T *src)
 add new pointer "src" if unique More...
 
void add_unique (const GPA< T > &src)
 add new pointers "src" if unique More...
 
bool replace_member_by (T *oldv, T *newv)
 

GET

const T ** v (void) const
 
T * operator[] (long i) const
 
T * first (void) const
 
T * last (void) const
 
T * at_or_null (long i) const
 
long operator() (void) const
 
long give_size (void) const
 
long give_asize (void) const
 
long give_num_nonNULL_ptrs () const
 get sum of nonNULL pointers in two levels More...
 
long give_num_nonNULL_ptrs2 () const
 get sum of nonNULL pointers in two levels More...
 

OTHER

bool is_member (T *val) const
 
bool is_unique (void) const
 
bool is_identical_with (const GPA< T > &one) const
 
bool has_same_members_as (const GPA< T > &one) const
 
bool has_these_members (const GPA< T > &one) const
 
bool has_these_members (long s, const T **one) const
 
void shake_down (void)
 

Detailed Description

template<class T>
class midaspace::GPA< T >

GPA - Generic Pointer Array, template class manages 1d array of pointers to objects of type T.

This class maitains only pointers to particular objects, objects itselfs are not contained within this array. They have to be created outside and then their pointers can be added to array. When destructor is called, the pointed object is not deleted. Inspirated by OOFEM/oofemlib/alist.h

Definition at line 23 of file gpa.h.

Constructor & Destructor Documentation

template<class T>
midaspace::GPA< T >::GPA ( void  )
inline

CONSTRUCTOR.

Definition at line 37 of file gpa.h.

template<class T>
midaspace::GPA< T >::GPA ( long  s,
long  ds = 1 
)
inline

CONSTRUCTOR.

Definition at line 39 of file gpa.h.

template<class T>
midaspace::GPA< T >::GPA ( const GPA< T > *  src)
inline

CONSTRUCTOR COPY.

Definition at line 41 of file gpa.h.

template<class T>
midaspace::GPA< T >::~GPA ( )
inline

DESTRUCTOR.

Definition at line 43 of file gpa.h.

Member Function Documentation

template<class T>
T* midaspace::GPA< T >::add ( T *  val)
inline

add (assign) new pointer to the end; enlarge the receiver if too small

Definition at line 157 of file gpa.h.

Referenced by midaspace::Mesh::adaptivity(), midaspace::GPA< midaspace::Point >::add_unique(), midaspace::PolyLine::init_point_on(), midaspace::Model::read_model_MELNIK(), and midaspace::TF_GPA_add_another().

template<class T>
void midaspace::GPA< T >::add_unique ( T *  src)
inline

add new pointer "src" if unique

Definition at line 191 of file gpa.h.

template<class T>
void midaspace::GPA< T >::add_unique ( const GPA< T > &  src)

add new pointers "src" if unique

Definition at line 328 of file gpa.h.

References errol.

template<class T>
void midaspace::GPA< T >::assign ( long  i,
T *  val 
)
inline

Definition at line 149 of file gpa.h.

template<class T>
T* midaspace::GPA< T >::at_or_null ( long  i) const
inline

Definition at line 235 of file gpa.h.

template<class T>
void midaspace::GPA< T >::be_copy_of ( const GPA< T > *  src)
inline

Definition at line 129 of file gpa.h.

Referenced by midaspace::GPA< midaspace::Point >::GPA().

template<class T>
void midaspace::GPA< T >::delete_object ( long  i)
inline

Delete object pointed by the i-th pointer. The pointer is set to NULL.

Definition at line 115 of file gpa.h.

template<class T>
void midaspace::GPA< T >::delete_objects ( void  )
inline

Delete all objects pointed by pointers. The pointers are set to NULL.

Definition at line 117 of file gpa.h.

template<class T>
T* midaspace::GPA< T >::first ( void  ) const
inline

Definition at line 222 of file gpa.h.

template<class T>
void midaspace::GPA< T >::free_ptr ( T *  val)
inline

Definition at line 111 of file gpa.h.

template<class T>
void midaspace::GPA< T >::free_ptr ( long  i)
inline

Definition at line 112 of file gpa.h.

template<class T>
void midaspace::GPA< T >::free_ptrs ( void  )
inline

Definition at line 110 of file gpa.h.

Referenced by midaspace::GPA< midaspace::Point >::delete_objects().

template<class T>
void midaspace::GPA< T >::free_ptrs_core ( long  newsize)
inline

reallocate down (free pointers) receiver without checking of sizes

Definition at line 62 of file gpa.h.

Referenced by midaspace::GPA< midaspace::Point >::realloc(), and midaspace::GPA< midaspace::Point >::reallocdown().

template<class T>
long midaspace::GPA< T >::give_asize ( void  ) const
inline

Definition at line 242 of file gpa.h.

template<class T>
long midaspace::GPA< T >::give_num_nonNULL_ptrs ( ) const
inline

get sum of nonNULL pointers in two levels

Definition at line 245 of file gpa.h.

Referenced by midaspace::GPA< midaspace::Point >::give_num_nonNULL_ptrs2().

template<class T>
long midaspace::GPA< T >::give_num_nonNULL_ptrs2 ( ) const
inline

get sum of nonNULL pointers in two levels

Definition at line 251 of file gpa.h.

template<class T>
long midaspace::GPA< T >::give_size ( void  ) const
inline
template<class T>
bool midaspace::GPA< T >::has_same_members_as ( const GPA< T > &  one) const
inline

Definition at line 281 of file gpa.h.

template<class T>
bool midaspace::GPA< T >::has_these_members ( const GPA< T > &  one) const
inline

Definition at line 282 of file gpa.h.

Referenced by midaspace::GPA< midaspace::Point >::has_these_members().

template<class T>
bool midaspace::GPA< T >::has_these_members ( long  s,
const T **  one 
) const
inline

Definition at line 283 of file gpa.h.

template<class T>
void midaspace::GPA< T >::initialize ( long  s,
long  ds = 0 
)
inline

Definition at line 120 of file gpa.h.

Referenced by midaspace::GPA< midaspace::Point >::GPA().

template<class T>
bool midaspace::GPA< T >::is_identical_with ( const GPA< T > &  one) const
inline

Definition at line 280 of file gpa.h.

template<class T>
bool midaspace::GPA< T >::is_member ( T *  val) const
inline

Definition at line 276 of file gpa.h.

Referenced by midaspace::GPA< midaspace::Point >::add_unique().

template<class T>
bool midaspace::GPA< T >::is_unique ( void  ) const
inline

Definition at line 277 of file gpa.h.

template<class T>
T* midaspace::GPA< T >::last ( void  ) const
inline

Definition at line 228 of file gpa.h.

Referenced by midaspace::PolyLine::divide().

template<class T>
long midaspace::GPA< T >::operator() ( void  ) const
inline

Definition at line 240 of file gpa.h.

template<class T>
T* midaspace::GPA< T >::operator[] ( long  i) const
inline

Definition at line 214 of file gpa.h.

template<class T>
void midaspace::GPA< T >::realloc ( long  new_asize)
inline

reallocate up receiver with checking the new size

Definition at line 67 of file gpa.h.

Referenced by midaspace::GPA< midaspace::Point >::resize().

template<class T>
void midaspace::GPA< T >::realloc_core ( long  new_asize)
inline

reallocate up receiver without checking of sizes

Definition at line 52 of file gpa.h.

Referenced by midaspace::GPA< midaspace::Point >::realloc(), midaspace::GPA< midaspace::Point >::reallocplus(), and midaspace::GPA< midaspace::Point >::reallocup().

template<class T>
void midaspace::GPA< T >::reallocdown ( long  new_asize)
inline

reallocate up receiver with checking the new size

Definition at line 83 of file gpa.h.

Referenced by midaspace::GPA< midaspace::Point >::resizedown().

template<class T>
void midaspace::GPA< T >::reallocplus ( long  d)
inline

reallocate receiver to the new size

Definition at line 89 of file gpa.h.

template<class T>
void midaspace::GPA< T >::reallocup ( long  new_asize)
inline

reallocate up receiver with checking the new size

Definition at line 74 of file gpa.h.

Referenced by midaspace::GPA< midaspace::Point >::add(), and midaspace::GPA< midaspace::Point >::resizeup().

template<class T>
bool midaspace::GPA< T >::replace_member_by ( T *  oldv,
T *  newv 
)
inline

Definition at line 195 of file gpa.h.

template<class T>
void midaspace::GPA< T >::resize ( long  newsize)
inline

reallocate receiver to the new size

Definition at line 98 of file gpa.h.

Referenced by midaspace::Model::generate_mesh_RFbyHN().

template<class T>
void midaspace::GPA< T >::resize_zero ( void  )
inline

Definition at line 101 of file gpa.h.

template<class T>
void midaspace::GPA< T >::resizedown ( long  newsize)
inline

Definition at line 100 of file gpa.h.

template<class T>
void midaspace::GPA< T >::resizeup ( long  newsize)
inline

Definition at line 99 of file gpa.h.

template<class T>
void midaspace::GPA< T >::reverse ( )
inline

Definition at line 138 of file gpa.h.

template<class T >
void midaspace::GPA< T >::shake_down ( void  )
template<class T>
const T** midaspace::GPA< T >::v ( void  ) const
inline

Definition at line 212 of file gpa.h.

template<class T>
T* midaspace::GPA< T >::wedge ( long  i,
T *  val 
)
inline

!!!! toto predelat at se to zveda o asize + (dsize ? dsize : 0.1*asize+1);

Definition at line 164 of file gpa.h.

Referenced by midaspace::TF_GPA_wdg_another().

Member Data Documentation

template<class T>
long midaspace::GPA< T >::asize
protected
template<class T>
long midaspace::GPA< T >::dsize
protected
template<class T>
long midaspace::GPA< T >::size
protected

Definition at line 30 of file gpa.h.

Referenced by midaspace::GPA< midaspace::Point >::add(), midaspace::GPA< midaspace::Point >::assign(), midaspace::GPA< midaspace::Point >::at_or_null(), midaspace::GPA< midaspace::Point >::be_copy_of(), midaspace::GPA< midaspace::Point >::delete_objects(), midaspace::GPA< midaspace::Point >::first(), midaspace::GPA< midaspace::Point >::free_ptr(), midaspace::GPA< midaspace::Point >::give_num_nonNULL_ptrs(), midaspace::GPA< midaspace::Point >::give_num_nonNULL_ptrs2(), midaspace::GPA< midaspace::Point >::give_size(), midaspace::GPA< midaspace::Point >::GPA(), midaspace::GPA< midaspace::Point >::has_same_members_as(), midaspace::GPA< midaspace::Point >::has_these_members(), midaspace::GPA< midaspace::Point >::initialize(), midaspace::GPA< midaspace::Point >::is_identical_with(), midaspace::GPA< midaspace::Point >::is_member(), midaspace::GPA< midaspace::Point >::is_unique(), midaspace::GPA< midaspace::Point >::last(), midaspace::GPA< midaspace::Point >::operator()(), midaspace::GPA< midaspace::Point >::operator[](), midaspace::GPA< midaspace::Point >::realloc_core(), midaspace::GPA< midaspace::Point >::reallocplus(), midaspace::GPA< midaspace::Point >::replace_member_by(), midaspace::GPA< midaspace::Point >::resize(), midaspace::GPA< midaspace::Point >::resize_zero(), midaspace::GPA< midaspace::Point >::resizedown(), midaspace::GPA< midaspace::Point >::resizeup(), midaspace::GPA< midaspace::Point >::reverse(), and midaspace::GPA< midaspace::Point >::wedge().

template<class T>
T** midaspace::GPA< T >::values
protected

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