macros.h File Reference
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <osg/ref_ptr>
Include dependency graph for macros.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 gepetto
 
 gepetto::viewer
 

Macros

#define ASSERT(condition, message)
 
#define DEF_CLASS_SMART_PTR(className)
 
#define DEF_OSG_CLASS_REF_PTR(className)
 
#define SCENE_VIEWER_ACCEPT_VISITOR
 

Macro Definition Documentation

◆ ASSERT

#define ASSERT (   condition,
  message 
)
Value:
do { \
if (! (condition)) { \
std::cerr << "Assertion `" #condition "` failed in " << __FILE__ \
<< " line " << __LINE__ << ": " << message << std::endl; \
std::exit(EXIT_FAILURE); \
} \
} while (false)

Define default asserting macro

◆ DEF_CLASS_SMART_PTR

#define DEF_CLASS_SMART_PTR (   className)
Value:
class className; \
typedef ::gepetto::viewer::shared_ptr<className> className##Ptr_t; \
typedef ::gepetto::viewer::shared_ptr<const className> className##ConstPtr_t; \
typedef ::gepetto::viewer::weak_ptr<className> className##WeakPtr; \
typedef ::gepetto::viewer::weak_ptr<const className> className##ConstWeakPtr; \

Automatic builder of shared_ptr and weak_ptr for a class defined by its className

◆ DEF_OSG_CLASS_REF_PTR

#define DEF_OSG_CLASS_REF_PTR (   className)
Value:
/*class className;*/ \
typedef ::osg::ref_ptr< className > className##RefPtr; \
typedef ::osg::observer_ptr< className > className##ObserverPtr;

◆ SCENE_VIEWER_ACCEPT_VISITOR

#define SCENE_VIEWER_ACCEPT_VISITOR
Value:
\
virtual void accept (NodeVisitor& nv) { if (nv.valid(*this)) { nv.apply (*this); } } \