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

This is the base class for const elements. More...

#include <sharedheap.h>

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

Public Types

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

Public Member Functions

 ConstSharedHeap ()
 Create from nothing. More...
 
 ConstSharedHeap (T *pointer, const Tsize &size)
 Create representation for externally managed memory. More...
 
 ConstSharedHeap (const Tcontainer &sharedheap)
 Copy representation to share heap. More...
 
 ~ConstSharedHeap ()
 Deallocate heap memory if this is the last referencing instance. More...
 
ConstSharedHeap< T > & operator= (const Tcontainer &sharedheap)
 Copy representation to share heap. More...
 
const Tsizesize () const
 
const T * array () const
 
const T & operator[] (const Tsubscript &i) const
 Index operator (always inline). More...
 

Protected Member Functions

 ConstSharedHeap (const Tsize &size)
 Allocate new heap memory. More...
 
T & write_access (const Tsubscript &i) const
 write access to data More...
 
T * writable_array ()
 

Private Types

typedef aff::util::SHeap< T > Theapstruct
 Type of SHeap struct to be used in any case. More...
 

Private Attributes

TheapstructMheapstruct
 shared heap structure More...
 

Detailed Description

template<class T>
class aff::ConstSharedHeap< T >

This is the base class for const elements.

This is the base class for aff::SharedHeap. Although it accesses the data in memory through a pointer of type T*, it does not allow modification of the data through public access. Only for derived classes protected members are provided that allow modification of the data.

The whole functionality of shared heap (see "\ref page_representation") is implemented within this base class. aff::SharedHeap is only a sparse wrapper.

See also
aff::SharedHeap
aff::SHeap
Notes on the const-correctness of arrays
The concept of represented memory
Examples:
tests/arraytest.cc, and tests/reprtest.cc.

Definition at line 139 of file sharedheap.h.


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