lestes::std::ptr< T > Class Template Reference

#include <ptr.hh>

Inheritance diagram for lestes::std::ptr< T >:

Inheritance graph
[legend]
List of all members.

Public Types

typedef T pointee_type
 the type pointed to

Public Member Functions

 ptr (void)
 Creates ptr, initializes with NULL pointer.
 ptr (T *a_pointer)
 Creates ptr, initializes with pointer .
template<typename U>
 ptr (U *a_pointer)
 Creates ptr, initializes with pointer .
 ptr (const ptr< T > &other)
 Creates ptr, initializes with ptr to the same type.
template<typename U>
 ptr (const ptr< U > &other)
 Creates ptr, initializes with ptr.
template<typename U>
 ptr (const srp< U > &other)
 Creates ptr, initializes with srp.
 ~ptr (void)
 Destroys ptr.
T * operator-> (void) const
 Returns the pointer.
T & operator * (void) const
 Returns dereferenced pointer.
ptr< T > & operator= (T *a_pointer)
 Assigns a pointer.
template<typename U>
ptr< T > & operator= (U *a_pointer)
 Assigns a pointer.
ptr< T > & operator= (const ptr< T > &other)
 Assigns ptr of the same type.
template<typename U>
ptr< T > & operator= (const ptr< U > &other)
 Assigns ptr.
template<typename U>
ptr< T > & operator= (const srp< U > &other)
 Assigns srp.
 operator condition * (void) const
 Tests NULL pointer.
bool operator! (void) const
 Tests non NULL pointer.
bool operator== (T *a_pointer) const
 Compares to pointer.
template<typename U>
bool operator== (U *a_pointer) const
 Compares to pointer.
bool operator== (::std::ptrdiff_t a_pointer) const
 Compares to NULL.
template<typename U>
bool operator== (const ptr< U > &other) const
 Compares to ptr.
template<typename U>
bool operator== (const srp< U > &other) const
 Compares to srp.
bool operator!= (T *a_pointer) const
 Compares to pointer.
template<typename U>
bool operator!= (U *a_pointer) const
 Compares to pointer.
bool operator!= (::std::ptrdiff_t a_pointer) const
 Compares to NULL.
template<typename U>
bool operator!= (const ptr< U > &other) const
 Compares to ptr.
template<typename U>
bool operator!= (const srp< U > &other) const
 Compares to srp.
template<typename U>
ptr< U > dncast (void) const
 Performs dynamic cast to other type.
T * pointer_get (void) const
 Returns the pointer.
bool operator< (const ptr< T > &) const
 Compares two pointers for ordering.

Private Member Functions

void pointer_set (T *a_pointer)
 Sets the pointer.

Classes

struct  condition
 Condition class. More...

Detailed Description

template<typename T>
class lestes::std::ptr< T >

Represents structure pointer.
Parameters:
T The type of object pointed to.


Member Typedef Documentation

template<typename T>
typedef T lestes::std::ptr< T >::pointee_type

the type pointed to

Author:
TMA


Constructor & Destructor Documentation

template<typename T>
lestes::std::ptr< T >::ptr ( void   )  [inline]

Creates ptr, initializes with NULL pointer.

Creates ptr, initializes with NULL pointer.

Postcondition:
pointer_get() == NULL

template<typename T>
lestes::std::ptr< T >::ptr ( T *  a_pointer  )  [inline]

Creates ptr, initializes with pointer .

Creates ptr, initializes with pointer.

Postcondition:
pointer_get() == a_pointer
Parameters:
a_pointer The initialization value.

template<typename T>
template<typename U>
lestes::std::ptr< T >::ptr ( U *  a_pointer  )  [inline]

Creates ptr, initializes with pointer .

Creates ptr, initializes with pointer.

Postcondition:
pointer_get() == a_pointer
Parameters:
U The type of the initializer pointer.
a_pointer The initialization value.

template<typename T>
lestes::std::ptr< T >::ptr ( const ptr< T > &  other  )  [inline]

Creates ptr, initializes with ptr to the same type.

Creates ptr, initializes with ptr to the same type. Workaround to avoid implicit copy constructor creation.

Postcondition:
pointer_get() == other.pointer_get()
Parameters:
other The ptr to initialize with.

template<typename T>
template<typename U>
lestes::std::ptr< T >::ptr ( const ptr< U > &  other  )  [inline]

Creates ptr, initializes with ptr.

Creates ptr, initializes with ptr.

Postcondition:
pointer_get() == other.pointer_get()
Parameters:
U The type of the initializer ptr.
other The ptr to initialize with.

template<typename T>
template<typename U>
lestes::std::ptr< T >::ptr ( const srp< U > &  other  )  [inline]

Creates ptr, initializes with srp.

Creates ptr, initializes with srp.

Postcondition:
pointer_get() == other.pointer_get()
Parameters:
U The type of the initializer srp.
other The srp to initialize with.

template<typename T>
lestes::std::ptr< T >::~ptr ( void   )  [inline]

Destroys ptr.

Destroys ptr.


Member Function Documentation

template<typename T>
T * lestes::std::ptr< T >::operator-> ( void   )  const [inline]

Returns the pointer.

Returns the pointer.

Returns:
The contained pointer.

template<typename T>
T & lestes::std::ptr< T >::operator * ( void   )  const [inline]

Returns dereferenced pointer.

Dereferences the pointer.

Returns:
The dereferenced pointer.

template<typename T>
ptr< T > & lestes::std::ptr< T >::operator= ( T *  a_pointer  )  [inline]

Assigns a pointer.

Assigns pointer.

Parameters:
a_pointer The pointer to assign.
Returns:
This ptr after the assignment.

template<typename T>
template<typename U>
ptr< T > & lestes::std::ptr< T >::operator= ( U *  a_pointer  )  [inline]

Assigns a pointer.

Assigns pointer.

Parameters:
U The type of the assigned pointer.
a_pointer The pointer to assign.
Returns:
This ptr after the assignment.

template<typename T>
ptr< T > & lestes::std::ptr< T >::operator= ( const ptr< T > &  other  )  [inline]

Assigns ptr of the same type.

Assigns ptr of the same type. Workaround to avoid implicit assignment operator creation.

Parameters:
other The ptr to assign.
Returns:
This ptr after assignment.

template<typename T>
template<typename U>
ptr< T > & lestes::std::ptr< T >::operator= ( const ptr< U > &  other  )  [inline]

Assigns ptr.

Assigns ptr.

Parameters:
U The type of the assigned ptr.
other The ptr to assign.
Returns:
This ptr after assignment.

template<typename T>
template<typename U>
ptr< T > & lestes::std::ptr< T >::operator= ( const srp< U > &  other  )  [inline]

Assigns srp.

Assigns srp.

Parameters:
U The type of the assigned srp.
other The other srp to assign.
Returns:
This ptr after assignment.

template<typename T>
lestes::std::ptr< T >::operator condition * ( void   )  const [inline]

Tests NULL pointer.

Tests NULL pointer.

Returns:
Condition convertible to true if the pointer is NULL.

template<typename T>
bool lestes::std::ptr< T >::operator! ( void   )  const [inline]

Tests non NULL pointer.

Tests non NULL pointer.

Returns:
true if the pointer is not NULL.

template<typename T>
bool lestes::std::ptr< T >::operator== ( T *  a_pointer  )  const [inline]

Compares to pointer.

Compares to pointer.

Returns:
true if both pointers are equal.

template<typename T>
template<typename U>
bool lestes::std::ptr< T >::operator== ( U *  a_pointer  )  const [inline]

Compares to pointer.

Compares to pointer.

Parameters:
U The type of the compared pointer.
Returns:
true if both pointers are equal.

template<typename T>
bool lestes::std::ptr< T >::operator== ( ::std::ptrdiff_t  a_pointer  )  const [inline]

Compares to NULL.

Compares to NULL pointer. Workaround to avoid implicit bool conversion.

Returns:
true if both pointers are equal.

template<typename T>
template<typename U>
bool lestes::std::ptr< T >::operator== ( const ptr< U > &  other  )  const [inline]

Compares to ptr.

Compares to ptr.

Parameters:
U The type of the compared pointer.
Returns:
true if both pointers are equal.

template<typename T>
template<typename U>
bool lestes::std::ptr< T >::operator== ( const srp< U > &  other  )  const [inline]

Compares to srp.

Compares to other srp.

Parameters:
U The type of the compared srp.
Returns:
true if both pointers are equal.

template<typename T>
bool lestes::std::ptr< T >::operator!= ( T *  a_pointer  )  const [inline]

Compares to pointer.

Compares to pointer.

Returns:
false if both pointers are equal.

template<typename T>
template<typename U>
bool lestes::std::ptr< T >::operator!= ( U *  a_pointer  )  const [inline]

Compares to pointer.

Compares to pointer.

Parameters:
U The type of the compared pointer.
Returns:
false if both pointers are equal.

template<typename T>
bool lestes::std::ptr< T >::operator!= ( ::std::ptrdiff_t  a_pointer  )  const [inline]

Compares to NULL.

Compares to NULL pointer. Workaround to avoid implicit bool conversion.

Returns:
false if both pointers are equal.

template<typename T>
template<typename U>
bool lestes::std::ptr< T >::operator!= ( const ptr< U > &  other  )  const [inline]

Compares to ptr.

Compares to ptr.

Parameters:
U The type of the compared pointer.
Returns:
false if both pointers are equal.

template<typename T>
template<typename U>
bool lestes::std::ptr< T >::operator!= ( const srp< U > &  other  )  const [inline]

Compares to srp.

Compares to other srp.

Parameters:
U The type of the compared srp.
Returns:
false if both pointers are equal.

template<typename T>
template<typename U>
ptr< U > lestes::std::ptr< T >::dncast ( void   )  const [inline]

Performs dynamic cast to other type.

Performs dynamic cast on pointers.

When the dynamic type of the pointee is not the requested one or one derived from it, the function fails with an assertion. Null pointers do not make the function fail.

Parameters:
U The type of the target ptr.
Returns:
New ptr initialized with this ptr pointer.

template<typename T>
T * lestes::std::ptr< T >::pointer_get ( void   )  const [inline]

Returns the pointer.

Returns the pointer.

Returns:
The contained pointer.

Reimplemented from lestes::std::mem::root_pointer.

template<typename T>
bool lestes::std::ptr< T >::operator< ( const ptr< T > &  b  )  const [inline]

Compares two pointers for ordering.

Compares the pointer with a given one.

Parameters:
b The pointer to compare with.

template<typename T>
void lestes::std::ptr< T >::pointer_set ( T *  a_pointer  )  [inline, private]

Sets the pointer.

Sets the pointer.

Parameters:
a_pointer The pointer to set.


The documentation for this class was generated from the following files:
Generated on Mon Feb 12 18:50:06 2007 for lestes by doxygen 1.5.1-20070107