AFF --- A container for numbers (array) by Friederich and Forbriger.
aff::SharedHeap< T > Class Template Reference

A template class to share heap memory for different array projections. More...

#include <sharedheap.h>

Inheritance diagram for aff::SharedHeap< T >:
Collaboration diagram for aff::SharedHeap< T >:

Public Types

typedef T Tvalue
 Element type. More...
 
typedef T * Tpointer
 Type of pointer to element. More...
 
typedef T & Treference
 Type of reference to element. More...
 
typedef aff::SharedHeap< T > Tcontainer
 this class More...
 
typedef aff::ConstSharedHeap< T > Tbase
 base class More...
 
typedef Tbase Tcontainer_of_const
 Type of const version of SharedHeap. More...
 
typedef Tbase Tcoc
 short for container of const More...
 

Public Member Functions

 SharedHeap ()
 Create from nothing. More...
 
 SharedHeap (const Tsize &size)
 Allocate new heap memory. More...
 
 SharedHeap (T *pointer, const Tsize &size)
 Create representation for externally managed memory. More...
 
 SharedHeap (const Tcontainer &sharedheap)
 Copy representation to share heap. More...
 
 ~SharedHeap ()
 Deallocate heap memory if this is the last referencing instance. More...
 
T & operator[] (const Tsubscript &i) const
 delegate to base More...
 
T * array () const
 
const Tsizesize () const
 
access declarations
const Tsizesize () const
 access to base class function More...
 
const T * array () const
 

Protected Member Functions

T & write_access (const Tsubscript &i) const
 write access to data More...
 
T * writable_array ()
 

Detailed Description

template<class T>
class aff::SharedHeap< T >

A template class to share heap memory for different array projections.

This is a wrapper class that inherits publicly from aff::ConstSharedHeap. Thus containers of type aff::SharedHeap and aff::ConstSharedHeap may share the reference to memory through which they access the data. And the conversion to the base class that does not allow modification of elements is a trivial conversion.

This class essentially adds no functionality. It just provides public access to the protected members of aff::ConstSharedHeap. For further documentation see there.

See also
The concept of represented memory
aff::ConstSharedHeap
Examples:
tests/arraytest.cc, and tests/reprtest.cc.

Definition at line 252 of file sharedheap.h.


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