GCpp::gc_container< T > Class Template Reference

Pointer type to be used for 'managed' containers of 'managed' objects. More...

#include <gc++.hpp>

Inheritance diagram for GCpp::gc_container< T >:

Inheritance graph
[legend]
Collaboration diagram for GCpp::gc_container< T >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 gc_container ()
 Default constructor.
 gc_container (T *p_item)
 Constructor.
gc_container< T > & operator= (const gc_container< T > &p_other)
 Assignment.
gc_container< T > & operator= (T *p_item)
 Assignment.
 operator bool ()
 Conversion to bool.
T * operator-> () const
 Access.
T & operator * () const
 Access.
void * storage () const
 accessor

Public Attributes

GCBasePointernext
 Implementation detail.
GCBasePointerprior
 Implementation detail.

Protected Member Functions

char fetch_state ()
 state

Protected Attributes

void * f_storage
 the managed object
char f_state
 state


Detailed Description

template<class T>
class GCpp::gc_container< T >

Pointer type to be used for 'managed' containers of 'managed' objects.

If the need to hold STL containerswith gc_new'd objects, it is best to put them into a container which itself has been allocated by gcnew and is referenced by an instance of the following class.

Definition at line 326 of file gc++.hpp.


Constructor & Destructor Documentation

template<class T>
GCpp::gc_container< T >::gc_container ( T *  p_item  )  [inline, explicit]

Constructor.

Parameters:
p_item pointee

Definition at line 338 of file gc++.hpp.


Member Function Documentation

template<class T>
GCpp::gc_container< T >::operator bool (  )  [inline]

Conversion to bool.

Returns:
true = pointer points to something

Definition at line 361 of file gc++.hpp.

References GCpp::GCBasePointer::f_storage.

template<class T>
T* GCpp::gc_container< T >::operator-> (  )  const [inline]

Access.

Returns:
memory address this points to, maybe 0

Definition at line 369 of file gc++.hpp.

References GCpp::GCBasePointer::f_storage.

template<class T>
T& GCpp::gc_container< T >::operator * (  )  const [inline]

Access.

Unspecified behaviour (read: crash) if there is nothing to dereference.

Returns:
dereferenced memory

Definition at line 379 of file gc++.hpp.

References GCpp::GCBasePointer::f_storage.


The documentation for this class was generated from the following file:
Generated on Thu Dec 27 14:02:01 2007 for GC++ by  doxygen 1.5.4