Bayeux  3.4.1
Core Foundation library for SuperNEMO
Macros
handle_macros.h File Reference
#include <stdexcept>
#include <sstream>
#include <boost/preprocessor/stringize.hpp>
#include <datatools/handle.h>

Go to the source code of this file.

Macros

#define DATATOOLS_HANDLE_DECLARE(HandleVar, Type)
 
#define DATATOOLS_HANDLE_DECLARE_NEW(HandleVar, Type)
 
#define DATATOOLS_HANDLE_GET_REF(RefVar, HandleVar, Type)
 
#define DATATOOLS_HANDLE_GRAB_REF(RefVar, HandleVar, Type)
 

Macro Definition Documentation

◆ DATATOOLS_HANDLE_DECLARE

#define DATATOOLS_HANDLE_DECLARE (   HandleVar,
  Type 
)
Value:
\
Templatized handle class that wraps a Boost shared pointer and behaves like a reference.
Definition: handle.h:114

◆ DATATOOLS_HANDLE_DECLARE_NEW

#define DATATOOLS_HANDLE_DECLARE_NEW (   HandleVar,
  Type 
)
Value:
::datatools::handle<Type> HandleVar(new Type); \
\
Templatized handle class that wraps a Boost shared pointer and behaves like a reference.
Definition: handle.h:114

◆ DATATOOLS_HANDLE_GET_REF

#define DATATOOLS_HANDLE_GET_REF (   RefVar,
  HandleVar,
  Type 
)
Value:
DT_THROW_IF (! HandleVar, \
std::logic_error, \
"Handle '" << BOOST_PP_STRINGIZE(HandleVar) << "' has no data !"); \
const Type& RefVar = HandleVar.get();
#define DT_THROW_IF(Condition, ExceptionType, Message)
Definition: exception.h:76

◆ DATATOOLS_HANDLE_GRAB_REF

#define DATATOOLS_HANDLE_GRAB_REF (   RefVar,
  HandleVar,
  Type 
)
Value:
DT_THROW_IF (! HandleVar, \
std::logic_error, \
"Handle '" << BOOST_PP_STRINGIZE(HandleVar) << "' has no data !"); \
Type& RefVar = HandleVar.grab();
#define DT_THROW_IF(Condition, ExceptionType, Message)
Definition: exception.h:76