libpgplotxx.a (C++ interface to PGPLOT)
|
Base class for handles. More...
#include <pghandle.h>
Public Types | |
Typedefs for class template HandleOfConst. | |
| |
typedef X | Tvalue |
typedef X * | Tpointer |
typedef X & | Treference |
typedef const X * | Tpointer_to_const |
typedef const X & | Treference_to_const |
typedef HandleOfConst< Tvalue > | Tcontainer |
typedef Tcontainer | Tcontainer_of_const |
typedef Tcontainer_of_const | Tcoc |
Public Member Functions | |
~HandleOfConst () | |
Destructor that takes care of reference count. More... | |
template<class Y > | |
Tcontainer & | operator= (const HandleOfConst< Y > &h) |
Assignement operator that provide transparency for inheritance. More... | |
Constructors | |
HandleOfConst () | |
Default constructor if class X provides one too. More... | |
HandleOfConst (Treference_to_const x) | |
Constructor to initialize the handle. More... | |
template<class Y > | |
HandleOfConst (const HandleOfConst< Y > &h) | |
Copy constructor that provides transparency for inheritance. More... | |
Read access operators | |
Tpointer_to_const | operator-> () const |
Read access operator with pointer semantics. More... | |
Treference_to_const | operator* () const |
Read access operator with pointer semantics. More... | |
Protected Member Functions | |
Write access operators must be protected | |
Tpointer | pointer () const |
expose the pointer to derived classes More... | |
Treference | reference () const |
expose the object to derived classes More... | |
Private Attributes | |
Tpointer | Mpointer |
internal pointer to the handled object More... | |
int * | Mpcount |
reference counter More... | |
Friends | |
template<class Y > | |
class | HandleOfConst |
friend declaration to other Handle templates is essential for inheritance transparency. More... | |
Base class for handles.
The base class is necessary to promise constness for values that are passed around using handles. Consider a code that uses a handle to pass the contents of a class of type A as defined by
A function sample can accept a handle providing access to the values of type A but promising not to changes these values if declared
or briefly
Declaring the function
is not sufficient, since this only promises constness of the handle but not of the values that can be accessed through the handle.
Definition at line 85 of file pghandle.h.