Zero  0.1.0
Public Member Functions | Static Public Member Functions | List of all members
pointer_guard_t< T > Struct Template Reference

Ensures that a pointer allocated with a call to operator new() gets deleted. More...

#include <guard.h>

Inheritance diagram for pointer_guard_t< T >:
pointer_guard_base_t< T, pointer_guard_t< T > > guard_base_t< T *, pointer_guard_t< T > >

Public Member Functions

 pointer_guard_t (T *ptr=nullptr)
 
- Public Member Functions inherited from pointer_guard_base_t< T, pointer_guard_t< T > >
 pointer_guard_base_t (T *ptr)
 
Toperator* () const
 
 operator T* () const
 
Toperator-> () const
 
- Public Member Functions inherited from guard_base_t< T *, pointer_guard_t< T > >
 guard_base_t (T * obj)
 
 guard_base_t (const guard_base_t &other)
 
guard_base_toperator= (const guard_base_t &other)
 
 operator T* () const
 
Tget () const
 
Trelease () const
 Notifies this guard that its services are no longer needed because some other entity has assumed ownership of the pointer. More...
 
void done () const
 Notifies this guard that its action should be performed now rather than at destruct time. More...
 
 ~guard_base_t ()
 

Static Public Member Functions

static void guard_action (T *ptr)
 
- Static Public Member Functions inherited from guard_base_t< T *, pointer_guard_t< T > >
static Tnull_value ()
 
static bool different (const T * &a, const T * &b)
 

Additional Inherited Members

- Public Types inherited from pointer_guard_base_t< T, pointer_guard_t< T > >
typedef guard_base_t< T *, pointer_guard_t< T > > Base
 
- Public Types inherited from guard_base_t< T *, pointer_guard_t< T > >
typedef guard_base_t< T *, pointer_guard_t< T > > Base
 
- Protected Member Functions inherited from guard_base_t< T *, pointer_guard_t< T > >
void assign (T * obj) const
 
- Protected Attributes inherited from guard_base_t< T *, pointer_guard_t< T > >
T_obj
 

Detailed Description

template<class T>
struct pointer_guard_t< T >

Ensures that a pointer allocated with a call to operator new() gets deleted.

Constructor & Destructor Documentation

§ pointer_guard_t()

template<class T >
pointer_guard_t< T >::pointer_guard_t ( T ptr = nullptr)
inline

Member Function Documentation

§ guard_action()

template<class T >
static void pointer_guard_t< T >::guard_action ( T ptr)
inlinestatic

The documentation for this struct was generated from the following file: