Thread portable class


Gate portable class


Timer class


Pool class


Terimber 2.0


About C++


Downloads Products & Services Support Clients Open Source About



Home / Open source / Terimber 2.0

smart_pointer< C > Class Template Reference

type of creator More...

#include <template.h>

List of all members.

Public Types

typedef TYPENAME C::TYPE TYPE
 type of object
typedef TYPENAME C::ARG ARG
 argumnet for creator

Public Member Functions

 smart_pointer (C &crt, const ARG &n)
 constructor object internally created
 smart_pointer (C &crt)
 constructor object will later assign explicitly
 ~smart_pointer ()
 destructor
smart_pointer< C > & operator= (const TYPE *x)
 assign operator
 operator TYPENAME smart_pointer< C >::TYPE * ()
 operator TYPE*
 operator const TYPENAME smart_pointer< C >::TYPE * () const
 operator const TYPE*
TYPENAME smart_pointer< C >::TYPEoperator-> ()
 operator->
const TYPENAME smart_pointer
< C >::TYPE
operator-> () const
 operator-> (const)
TYPENAME smart_pointer< C >
::TYPE ** 
operator & ()
 access operator to the address of pointer to object interface support
bool operator! () const
 checks object
void clear ()
 destroy object
TYPENAME smart_pointer< C >::TYPEdetach ()
 detaches object
void attach (TYPE *obj, bool free=true)
 attaches a new object and frees the old object if specified

Private Attributes

TYPENAME smart_pointer< C >::TYPE_ptr
 keeps poiter to object
C & _crt
 keeps reference to creator


Detailed Description

template<class C>
class smart_pointer< C >

type of creator

template class supports smart allocation and deallocation the pointer to the objects creator must provide two function T* create(size_t) & destroy(T*)

Definition at line 153 of file template.h.


Member Typedef Documentation

template<class C>
smart_pointer< C >::TYPE

type of object

Definition at line 158 of file template.h.

template<class C>
smart_pointer< C >::ARG

argumnet for creator

Definition at line 161 of file template.h.


Constructor & Destructor Documentation

template<class C>
smart_pointer< C >::smart_pointer ( C &  crt,
const ARG n 
) [inline, explicit]

constructor object internally created

Parameters:
crt  creator reference
n  argument

Definition at line 230 of file template.hpp.

References smart_pointer< C >::_ptr.

template<class C>
smart_pointer< C >::smart_pointer ( C &  crt  )  [inline, explicit]

constructor object will later assign explicitly

Parameters:
crt  creator reference

Definition at line 239 of file template.hpp.

template<class C>
smart_pointer< C >::~smart_pointer (  )  [inline]

destructor

Definition at line 246 of file template.hpp.

References smart_pointer< C >::clear().


Member Function Documentation

template<class C>
smart_pointer< C > & smart_pointer< C >::operator= ( const TYPE x  )  [inline]

assign operator

Definition at line 255 of file template.hpp.

References smart_pointer< C >::_ptr, smart_pointer< C >::clear(), and TYPENAME.

template<class C>
smart_pointer< C >::operator TYPENAME smart_pointer< C >::TYPE * (  )  [inline]

operator TYPE*

Definition at line 178 of file template.h.

References smart_pointer< C >::_ptr.

template<class C>
smart_pointer< C >::operator const TYPENAME smart_pointer< C >::TYPE * (  )  const [inline]

operator const TYPE*

Definition at line 184 of file template.h.

template<class C>
TYPENAME smart_pointer< C >::TYPE * smart_pointer< C >::operator-> (  )  [inline]

operator->

Definition at line 265 of file template.hpp.

References smart_pointer< C >::_ptr.

template<class C>
const TYPENAME smart_pointer< C >::TYPE * smart_pointer< C >::operator-> (  )  const [inline]

operator-> (const)

Definition at line 273 of file template.hpp.

References smart_pointer< C >::_ptr.

template<class C>
TYPENAME smart_pointer< C >::TYPE ** smart_pointer< C >::operator & (  )  [inline]

access operator to the address of pointer to object interface support

Definition at line 283 of file template.hpp.

References smart_pointer< C >::_ptr.

template<class C>
bool smart_pointer< C >::operator! (  )  const [inline]

checks object

Definition at line 292 of file template.hpp.

References smart_pointer< C >::_ptr.

template<class C>
void smart_pointer< C >::clear (  )  [inline]

template<class C>
void smart_pointer< C >::attach ( TYPE obj,
bool  free = true 
) [inline]

attaches a new object and frees the old object if specified

Parameters:
obj  new object pointer
free  flag to free the old object

Definition at line 324 of file template.hpp.

References smart_pointer< C >::_ptr, smart_pointer< C >::clear(), and smart_pointer< C >::detach().


Member Data Documentation

template<class C>
C& smart_pointer< C >::_crt [private]

keeps reference to creator

Definition at line 211 of file template.h.

Referenced by smart_pointer< C >::clear().


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


© Copyright Terimber 2003-.