ARB
Classes | Macros | Functions
smartptr.h File Reference
#include <arb_assert.h>
#include "arbtools.h"
Include dependency graph for smartptr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  custom_dealloc_ptr< T, DEALLOC >
 
class  auto_free_ptr< T >
 
class  auto_delete_ptr< T >
 
class  auto_delete_array_ptr< T >
 
class  SmartPtr< T, C >
 Generic smart pointer. More...
 
class  Counted< T, AP >
 
class  SmartPtr< T, C >
 Generic smart pointer. More...
 

Macros

#define tpl_assert(bed)   arb_assert(bed)
 
#define SmartArrayPtr(type)   SmartPtr<type, Counted<type, auto_delete_array_ptr<type> > >
 
#define SmartMallocPtr(type)   SmartPtr<type, Counted<type, auto_free_ptr<type> > >
 
#define SmartCustomPtr(type, deallocator)   SmartPtr<type, Counted<type, custom_dealloc_ptr<type, deallocator> > >
 
#define DUMP_SMART_PTRS_DO(cmd)
 
#define RETURN_LOCAL_ALLOC(mallocation)
 
#define RETURN_ONETIME_ALLOC(allocated)
 

Functions

template<class T , class C >
bool operator== (const SmartPtr< T, C > &s1, const SmartPtr< T, C > &s2)
 
template<class T , class C >
bool operator!= (const SmartPtr< T, C > &s1, const SmartPtr< T, C > &s2)
 
typedef SmartMallocPtr (char) SmartCharPtr
 

Macro Definition Documentation

#define tpl_assert (   bed)    arb_assert(bed)
#define SmartArrayPtr (   type)    SmartPtr<type, Counted<type, auto_delete_array_ptr<type> > >

Definition at line 44 of file smartptr.h.

#define SmartMallocPtr (   type)    SmartPtr<type, Counted<type, auto_free_ptr<type> > >

Definition at line 45 of file smartptr.h.

Referenced by GB_command_interpreter_in_env(), and readable_probe().

#define SmartCustomPtr (   type,
  deallocator 
)    SmartPtr<type, Counted<type, custom_dealloc_ptr<type, deallocator> > >

Definition at line 46 of file smartptr.h.

#define DUMP_SMART_PTRS_DO (   cmd)
#define RETURN_LOCAL_ALLOC (   mallocation)
Value:
static SmartMallocPtr(typeof(*mallocation)) static_ptr; \
static_ptr.assign(mallocation); \
return static_ptr.content();
#define SmartMallocPtr(type)
Definition: smartptr.h:45

Definition at line 310 of file smartptr.h.

Referenced by GB_get_db_path(), GBS_nameserver_tag(), PT_FamilyFinder::results2string(), shorttimekeep(), and upcase().

#define RETURN_ONETIME_ALLOC (   allocated)
Value:
static SmartMallocPtr(typeof(*allocated)) static_ptr; \
if (static_ptr.isNull()) { static_ptr = allocated; } \
return static_ptr.content();
#define SmartMallocPtr(type)
Definition: smartptr.h:45
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
Definition: AW_awar.cxx:166

Definition at line 315 of file smartptr.h.

Referenced by flagDir(), GB_getcwd(), GBS_ptserver_logname(), runDir(), and unitTesterDir().

Function Documentation

template<class T , class C >
bool operator== ( const SmartPtr< T, C > &  s1,
const SmartPtr< T, C > &  s2 
)

Definition at line 297 of file smartptr.h.

References SmartPtr< T, C >::sameObject().

template<class T , class C >
bool operator!= ( const SmartPtr< T, C > &  s1,
const SmartPtr< T, C > &  s2 
)

Definition at line 301 of file smartptr.h.

References SmartPtr< T, C >::sameObject().

typedef SmartMallocPtr ( char  )