blocxx
Classes | Namespaces | Defines | Typedefs | Functions | Variables

ScopeGuard.hpp File Reference

#include "blocxx/BLOCXX_config.h"
#include "blocxx/RefToValue.hpp"

Go to the source code of this file.

Classes

class  BLOCXX_NAMESPACE::ScopeGuardImplBase
class  BLOCXX_NAMESPACE::ScopeGuardImpl0< F >
class  BLOCXX_NAMESPACE::ScopeGuardImpl1< F, P1 >
class  BLOCXX_NAMESPACE::ScopeGuardImpl2< F, P1, P2 >
class  BLOCXX_NAMESPACE::ScopeGuardImpl3< F, P1, P2, P3 >
class  BLOCXX_NAMESPACE::ObjScopeGuardImpl0< Obj, MemFun >
class  BLOCXX_NAMESPACE::ObjScopeGuardImpl1< Obj, MemFun, P1 >
class  BLOCXX_NAMESPACE::ObjScopeGuardImpl2< Obj, MemFun, P1, P2 >

Namespaces

namespace  BLOCXX_NAMESPACE
 

Taken from RFC 1321.


Defines

#define BLOCXX_CONCATENATE_DIRECT(s1, s2)   s1##s2
#define BLOCXX_CONCATENATE(s1, s2)   BLOCXX_CONCATENATE_DIRECT(s1, s2)
#define BLOCXX_ANONYMOUS_VARIABLE(str)   BLOCXX_CONCATENATE(str, __LINE__)
#define BLOCXX_ON_BLOCK_EXIT   blocxx::ScopeGuard BLOCXX_ANONYMOUS_VARIABLE(scopeGuard) = blocxx::makeGuard
#define BLOCXX_ON_BLOCK_EXIT_OBJ   blocxx::ScopeGuard BLOCXX_ANONYMOUS_VARIABLE(scopeGuard) = blocxx::makeObjGuard

Typedefs

typedef const ScopeGuardImplBase & BLOCXX_NAMESPACE::ScopeGuard
 See Andrei's and Petru Marginean's CUJ article http://www.cuj.com/documents/s=8000/cujcexp1812alexandr/alexandr.htm.

Functions

template<typename F >
ScopeGuardImpl0< F > BLOCXX_NAMESPACE::makeGuard (F fun)
template<typename F , typename P1 >
ScopeGuardImpl1< F, P1 > BLOCXX_NAMESPACE::makeGuard (F fun, P1 p1)
template<typename F , typename P1 , typename P2 >
ScopeGuardImpl2< F, P1, P2 > BLOCXX_NAMESPACE::makeGuard (F fun, P1 p1, P2 p2)
template<typename F , typename P1 , typename P2 , typename P3 >
ScopeGuardImpl3< F, P1, P2, P3 > BLOCXX_NAMESPACE::makeGuard (F fun, P1 p1, P2 p2, P3 p3)
template<class Obj , typename MemFun >
ObjScopeGuardImpl0< Obj, MemFun > BLOCXX_NAMESPACE::makeObjGuard (Obj &obj, MemFun memFun)
template<class Obj , typename MemFun , typename P1 >
ObjScopeGuardImpl1< Obj,
MemFun, P1 > 
BLOCXX_NAMESPACE::makeObjGuard (Obj &obj, MemFun memFun, P1 p1)
template<class Obj , typename MemFun , typename P1 , typename P2 >
ObjScopeGuardImpl2< Obj,
MemFun, P1, P2 > 
BLOCXX_NAMESPACE::makeObjGuard (Obj &obj, MemFun memFun, P1 p1, P2 p2)

Variables

ObjScopeGuardImpl0< Obj1, Ret(Obj2::*)()> BLOCXX_NAMESPACE::makeGuard (Ret(Obj2::*memFun)(), Obj1 &obj)

Define Documentation

#define BLOCXX_ANONYMOUS_VARIABLE (   str)    BLOCXX_CONCATENATE(str, __LINE__)

Definition at line 386 of file ScopeGuard.hpp.

#define BLOCXX_CONCATENATE (   s1,
  s2 
)    BLOCXX_CONCATENATE_DIRECT(s1, s2)

Definition at line 385 of file ScopeGuard.hpp.

#define BLOCXX_CONCATENATE_DIRECT (   s1,
  s2 
)    s1##s2

Definition at line 384 of file ScopeGuard.hpp.

#define BLOCXX_ON_BLOCK_EXIT   blocxx::ScopeGuard BLOCXX_ANONYMOUS_VARIABLE(scopeGuard) = blocxx::makeGuard

Definition at line 388 of file ScopeGuard.hpp.

#define BLOCXX_ON_BLOCK_EXIT_OBJ   blocxx::ScopeGuard BLOCXX_ANONYMOUS_VARIABLE(scopeGuard) = blocxx::makeObjGuard

Definition at line 389 of file ScopeGuard.hpp.