0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Namespaces | Macros | Typedefs | Functions
ScopeGuard.h File Reference

Executes user-defined functions when leaving the current scope. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Hypertable::ScopeGuardImplBase
 Base class for the ScopeGuards. More...
 
class  Hypertable::ScopeGuardImpl0< FunT >
 ScopeGuard implementation for free function with no paramter. More...
 
class  Hypertable::ScopeGuardImpl1< FunT, P1T >
 ScopeGuard implementation for free function with 1 parameter. More...
 
class  Hypertable::ScopeGuardImpl2< FunT, P1T, P2T >
 ScopeGuard implementation for free function with 2 parameters. More...
 
class  Hypertable::ScopeGuardImpl3< FunT, P1T, P2T, P3T >
 ScopeGuard implementation for free function with 3 parameters. More...
 
class  Hypertable::ObjScopeGuardImpl0< ObjT, MethodT >
 ScopeGuard implementation for method with no parameter. More...
 
class  Hypertable::ObjScopeGuardImpl1< ObjT, MethodT, P1T >
 ScopeGuard implementation for method with 1 parameter. More...
 
class  Hypertable::ObjScopeGuardImpl2< ObjT, MethodT, P1T, P2T >
 ScopeGuard implementation for method with 2 parameters. More...
 
class  Hypertable::RefHolder< T >
 Helper class used to pass a parameter to the ScopeGuard by reference. More...
 

Namespaces

 Hypertable
 Hypertable definitions
 

Macros

#define HT_CONCAT_(s1, s2)   s1##s2
 
#define HT_CONCAT(s1, s2)   HT_CONCAT_(s1, s2)
 
#define HT_AUTO_VAR(var)   HT_CONCAT(var, __LINE__)
 
#define HT_ON_SCOPE_EXIT(...)
 
#define HT_ON_OBJ_SCOPE_EXIT(...)
 

Typedefs

typedef const ScopeGuardImplBase & Hypertable::ScopeGuard
 

Functions

template<typename FunT >
ScopeGuardImpl0< FunT > Hypertable::make_guard (FunT fun)
 
template<typename FunT , typename P1T >
ScopeGuardImpl1< FunT, P1T > Hypertable::make_guard (FunT fun, P1T p1)
 
template<typename FunT , typename P1T , typename P2T >
ScopeGuardImpl2< FunT, P1T, P2T > Hypertable::make_guard (FunT fun, P1T p1, P2T p2)
 
template<typename FunT , typename P1T , typename P2T , typename P3T >
ScopeGuardImpl3< FunT, P1T,
P2T, P3T > 
Hypertable::make_guard (FunT fun, P1T p1, P2T p2, P3T p3)
 
template<class ObjT , typename MethodT >
ObjScopeGuardImpl0< ObjT, MethodT > Hypertable::make_obj_guard (ObjT &obj, MethodT method)
 
template<class ObjT , typename MethodT , typename P1T >
ObjScopeGuardImpl1< ObjT,
MethodT, P1T > 
Hypertable::make_obj_guard (ObjT &obj, MethodT method, P1T p1)
 
template<class ObjT , typename MethodT , typename P1T , typename P2T >
ObjScopeGuardImpl2< ObjT,
MethodT, P1T, P2T > 
Hypertable::make_obj_guard (ObjT &obj, MethodT method, P1T p1, P2T p2)
 
template<class T >
RefHolder< T > Hypertable::by_ref (T &t)
 

Detailed Description

Executes user-defined functions when leaving the current scope.

Adapted from http://www.ddj.com/cpp/184403758

Definition in file ScopeGuard.h.

Macro Definition Documentation

#define HT_AUTO_VAR (   var)    HT_CONCAT(var, __LINE__)

Definition at line 299 of file ScopeGuard.h.

#define HT_CONCAT (   s1,
  s2 
)    HT_CONCAT_(s1, s2)

Definition at line 298 of file ScopeGuard.h.

#define HT_CONCAT_ (   s1,
  s2 
)    s1##s2

Definition at line 297 of file ScopeGuard.h.

#define HT_ON_OBJ_SCOPE_EXIT (   ...)
Value:
ScopeGuard HT_AUTO_VAR(guard) = make_obj_guard(__VA_ARGS__); \
const ScopeGuardImplBase & ScopeGuard
Definition: ScopeGuard.h:68
#define HT_AUTO_VAR(var)
Definition: ScopeGuard.h:299
#define HT_UNUSED(x)
Definition: Compat.h:50
ObjScopeGuardImpl2< ObjT, MethodT, P1T, P2T > make_obj_guard(ObjT &obj, MethodT method, P1T p1, P2T p2)
Definition: ScopeGuard.h:257

Definition at line 305 of file ScopeGuard.h.

#define HT_ON_SCOPE_EXIT (   ...)
Value:
ScopeGuard HT_AUTO_VAR(guard) = make_guard(__VA_ARGS__); \
ScopeGuardImpl3< FunT, P1T, P2T, P3T > make_guard(FunT fun, P1T p1, P2T p2, P3T p3)
Definition: ScopeGuard.h:170
const ScopeGuardImplBase & ScopeGuard
Definition: ScopeGuard.h:68
#define HT_AUTO_VAR(var)
Definition: ScopeGuard.h:299
#define HT_UNUSED(x)
Definition: Compat.h:50

Definition at line 301 of file ScopeGuard.h.