Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members   Related Pages  

Pointer Class Template Reference

Template class definition for a basic pointer type object. More...

#include <Pointer.h>

Inheritance diagram for Pointer::

BasicPointer List of all members.

Public Methods

 Pointer ()
 Constructor. More...

 Pointer (const Pointer< STYPE, ATYPE > &s)
 Copy constructor. More...

 Pointer (STYPE *s)
 Constructor with subscriptable. More...

 ~Pointer ()
 Destructor. More...

void Dump (ostream &aStream)
 Dump this pointer. More...

void Nullify ()
 Make this Pointer null. More...

bool IsNull ()
 Return true if this is a null pointer. More...

Pointer< STYPE, ATYPE > & operator= (const Pointer< STYPE, ATYPE > &s)
 Assign a Pointer to this. More...

Pointer< STYPE, ATYPE > & operator-= (const long i)
 Subtract from this. More...

Pointer< STYPE, ATYPE > & operator-= (Pointer< STYPE, ATYPE > &v)
 Subtract from this. More...

Pointer< STYPE, ATYPE > & operator+= (const long i)
 Add to this. More...

Pointer< STYPE, ATYPE > & operator+= (Pointer< STYPE, ATYPE > &v)
 Add to this. More...

Pointer< STYPE, ATYPE > & operator *= (const long i)
 Multiply this. More...

Pointer< STYPE, ATYPE > & operator *= (Pointer< STYPE, ATYPE > &v)
 Multiply this. More...

Pointer< STYPE, ATYPE > & operator/= (const long i)
 Divide this. More...

Pointer< STYPE, ATYPE > & operator/= (Pointer< STYPE, ATYPE > &v)
 Divide this. More...

Pointer< STYPE, ATYPE > & operator++ ()
 Prefix increment this. More...

Pointer< STYPE, ATYPE > & operator++ (int)
 Postfix increment this. More...

Pointer< STYPE, ATYPE > & operator-- ()
 Prefix decrement this. More...

Pointer< STYPE, ATYPE > & operator-- (int)
 Postfix decrement this. More...

long operator| (const Pointer< STYPE, ATYPE > &v)
 Calculate difference. More...

Pointer< STYPE, ATYPE > & operator+ (long v)
 Add an integer value. More...

Pointer< STYPE, ATYPE > & operator- (long v)
 Subtract an integer value. More...

Pointer< STYPE, ATYPE > & operator * (long v)
 Multiply by an integer value. More...

Pointer< STYPE, ATYPE > & operator/ (long v)
 Divide by an integer value. More...

int operator< (long v)
 Less than operator. More...

int operator< (Pointer< STYPE, ATYPE > &p)
 Less than operator. More...

int operator> (long v)
 Greater than operator. More...

int operator> (Pointer< STYPE, ATYPE > &p)
 Greater than operator. More...

int operator<= (long v)
 Less than or equal operator. More...

int operator<= (Pointer< STYPE, ATYPE > &p)
 Less than or equal operator. More...

int operator>= (long v)
 Greater than or equal operator. More...

int operator>= (Pointer< STYPE, ATYPE > &p)
 Greater than or equal operator. More...

int operator!= (long v)
 Not equal operator. More...

int operator!= (Pointer< STYPE, ATYPE > &p)
 Not equal operator. More...

ATYPE & operator * ()
 Dereference. More...

int operator== (const Pointer< STYPE, ATYPE > &s) const
 Equal operator. More...

int operator== (const char *s) const
 Equal operator. More...

STYPE * Get ()
 Return the object to which this points. More...

int GetIndex ()
 Return pointer index. More...

void Init (STYPE *s)
 Initialize. More...


Protected Attributes

STYPE * ptr
 A pointer to the underlying subscriptable object. More...

int pos
 Current pointer index. More...


Detailed Description

template<class STYPE, class ATYPE>
class Pointer< STYPE, ATYPE >

Template class definition for a basic pointer type object. Pointer objects expect to reference objects that support operator[]. Also, these objects must support a ReferenceBy() and DereferenceBy() function.

Author:
Eric Kasten
Version:
0.4.0


Constructor & Destructor Documentation

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::Pointer [inline]
 

Basic Constructor method for this.

Parameters:
None  
Returns:
this

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::Pointer const Pointer< STYPE, ATYPE > & s [inline]
 

Copy constructor method for this.

Parameters:
s   Another Pointer to copy.
Returns:
this

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::Pointer STYPE * s [inline]
 

Constructor with subscribtable object for this.

Parameters:
s   A subscriptable object.
Returns:
this

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::~Pointer [inline]
 

Pointer::~Pointer()

Class Destructor.

Parameters:
None  
Returns:
None


Member Function Documentation

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::Dump ostream & aStream [inline]
 

Dump a formated representation of this pointer pointer to an ostream. Used for debugging purposes.

Parameters:
aStream   The ostream to which to dump this pointer.
Returns:
None

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::Get [inline]
 

Return the underlying subscriptable object to which this points.

Parameters:
None  
Returns:
A pointer to the underlying object

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::GetIndex [inline, virtual]
 

Return the index position pointed to by this.

Parameters:
None  
Returns:
The index position

Reimplemented from BasicPointer.

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::Init STYPE * s [inline]
 

Initialize this with a subscriptable object.

Parameters:
s   A pointer to a subscriptable object.
Returns:
None

template<class STYPE, class ATYPE>
bool Pointer< STYPE, ATYPE >::IsNull [inline, virtual]
 

Pointer::IsNull()

Return true if this is a null pointer (as if Nullify() had been called on this).

Parameters:
None  
Returns:
Whether this Pointer is null.
Return values:
true   This Pointer is null.
false   This Pointer isn't null.

Reimplemented from BasicPointer.

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::Nullify [inline, virtual]
 

Set this Pointer to NULL by dereferencing the object to which it points and setting the position and pointer fields to null.

Parameters:
None  
Returns:
None

Reimplemented from BasicPointer.

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator * [inline]
 

Dereference this at the current index position. That is, return the value at the current index position held by this.

Parameters:
None  
Returns:
A reference to the value at the index held by this
Exceptions:
DAQOutOfBounds   If the current index is invalid

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator * long v [inline]
 

Multiply the index held by this by an (long) integer value.

Parameters:
v   An integer value to by which to multiply
Returns:
A reference to this

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator *= Pointer< STYPE, ATYPE > & v [inline]
 

Multiply the index held by this by another Pointer.

Parameters:
v   The other pointer by which to multiply
Returns:
A reference to this

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator *= const long i [inline]
 

Multiply the index held by this by an (const) integer value.

Parameters:
i   An integer value by which to multiply this
Returns:
A reference to this

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator!= Pointer< STYPE, ATYPE > & p [inline]
 

Determine if the index held by this is not equal to another Pointer index.

Parameters:
p   Another index to compare to this
Returns:
An integer indicating if this is not equal to p
Return values:
=0   this is not equal to p
==0   this is equal to p

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator!= long v [inline]
 

Determine if the index held by this is not equal to a (long) integer value.

Parameters:
v   An integer value to compare to this
Returns:
An integer indicating if this is not equal to v
Return values:
=0   this is not equal to v
==0   this is equal to v

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator+ long v [inline]
 

Add an (long) integer value to the index held by this.

Parameters:
v   An integer value to add to this
Returns:
A reference to this

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator++ int [inline]
 

Postfix increment the index held by this by one.

Parameters:
None  
Returns:
A reference to this

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator++ [inline]
 

Prefix increment the index held by this by one.

Parameters:
None  
Returns:
A reference to this

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator+= Pointer< STYPE, ATYPE > & v [inline]
 

Add the value held by another Pointer to the index held by this.

Parameters:
v   Another Pointer that has the same template signature.
Returns:
this

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator+= const long i [inline]
 

Add an (const) integer value to the index held by this.

Parameters:
i   An integer value to add to this
Returns:
A reference to this

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator- long v [inline]
 

Subtract an (long) integer value to the index held by this.

Parameters:
v   An integer value to subtract from this
Returns:
A reference to this

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator-- int [inline]
 

Postfix decrement the index held by this by one.

Parameters:
None  
Returns:
A reference to this

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator-- [inline]
 

Prefix decrement the index held by this by one.

Parameters:
None  
Returns:
A reference to this

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator-= Pointer< STYPE, ATYPE > & v [inline]
 

Subtract the value held by another Pointer from the index held by this.

Parameters:
v   The other pointer to subtract
Returns:
A reference to this

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator-= const long i [inline]
 

Subtract an (const) integer value from the index held by this.

Parameters:
i   An integer value by which to decrement this
Returns:
A reference to this

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator/ long v [inline]
 

Divide the index held by this by an (long) integer value.

Parameters:
v   An integer value to by which to divide
Returns:
A reference to this

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator/= Pointer< STYPE, ATYPE > & v [inline]
 

Divide the index held by this by another Pointer.

Parameters:
v   The other pointer by which to divide
Returns:
A reference to this

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator/= const long i [inline]
 

Divide the index held by this by an (const) integer value.

Parameters:
i   An integer value by which to divide this
Returns:
A reference to this

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator< Pointer< STYPE, ATYPE > & p [inline]
 

Determine if the index held by this is less than another Pointer index.

Parameters:
p   Another index to compare to this
Returns:
An integer indicating if this is less than p
Return values:
=0   this is less than p
==0   this isn't less than p

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator< long v [inline]
 

Determine if the index held by this is less than a (long) integer value.

Parameters:
v   An integer value to compare to this
Returns:
An integer indicating if this is less than v
Return values:
=0   this is less than v
==0   this isn't less than v

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator<= Pointer< STYPE, ATYPE > & p [inline]
 

Determine if the index held by this is less than or equal to another Pointer index.

Parameters:
p   Another index to compare to this
Returns:
An integer indicating if this is less than or equal to p
Return values:
=0   this is less than or equal to p
==0   this isn't less than or equal to p

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator<= long v [inline]
 

Determine if the index held by this is less than or equal to a (long) integer value.

Parameters:
v   An integer value to compare to this
Returns:
An integer indicating if this is less than or equal to v
Return values:
=0   this is less than or equal to v
==0   this isn't less than or equal to v

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator= const Pointer< STYPE, ATYPE > & s [inline]
 

Assign another pointer to this.

Parameters:
s   Another Pointer that has the same template signature.
Returns:
this

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator== const char * s const [inline]
 

Equality operator (principally for comparing to NULL)

Parameters:
s   A pointer value to compare to this
Returns:
An integer indicating if this is equal to s
Return values:
=0   this is equal to s
==0   this is not equal to s

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator== const Pointer< STYPE, ATYPE > & s const [inline]
 

Determine if the index held by this is equal to another Pointer index.

Parameters:
p   Another index to compare to this
Returns:
An integer indicating if this is equal to s
Return values:
=0   this is equal to s
==0   this is not equal to s

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator> Pointer< STYPE, ATYPE > & p [inline]
 

Determine if the index held by this is greater than another Pointer index.

Parameters:
p   Another index to compare to this
Returns:
An integer indicating if this is greater than p
Return values:
=0   this is greater than p
==0   this isn't greater than p

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator> long v [inline]
 

Determine if the index held by this is greater than a (long) integer value.

Parameters:
v   An integer value to compare to this
Returns:
An integer indicating if this is greater than v
Return values:
=0   this is greater than v
==0   this isn't greater than v

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator>= Pointer< STYPE, ATYPE > & p [inline]
 

Determine if the index held by this is greater than or equal to another Pointer index.

Parameters:
p   Another index to compare to this
Returns:
An integer indicating if this is greater than or equal to p
Return values:
=0   this is greater than or equal to p
==0   this isn't greater than or equal to p

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator>= long v [inline]
 

Determine if the index held by this is greater than or equal to a (long) integer value.

Parameters:
v   An integer value to compare to this
Returns:
An integer indicating if this is greater than or equal to v
Return values:
=0   this is greater than or equal to v
==0   this isn't greater than or equal to v

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::operator| const Pointer< STYPE, ATYPE > & v [inline]
 

Calcluate the difference between the indexes of two pointers.

Parameters:
v   Another pointer for calculating the difference
Returns:
A long integer value representing the difference


Member Data Documentation

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::pos [protected]
 

Current pointer index position.

template<class STYPE, class ATYPE>
Pointer< STYPE, ATYPE >::ptr [protected]
 

A pointer to the underlying subscriptable object pointed to by this.


The documentation for this class was generated from the following file:
Generated at Tue Jan 29 14:07:10 2002 for SpectroDAQ by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001