Visualization Library 2.0.0

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Classes | Namespaces | Macros | Functions
TypeInfo.hpp File Reference

Set of macros and templates implementing a simple and portable RTTI system. More...

#include <vlCore/MurmurHash3.hpp>

Go to the source code of this file.

Classes

struct  vl::TypeInfo
 Represents a class type. More...
 

Namespaces

 vl
 Visualization Library main namespace.
 

Macros

#define VL_GROUP(...)   __VA_ARGS__
 
#define VL_TO_STR(...)   #__VA_ARGS__
 
#define VL_INSTRUMENT_BASE_CLASS(ClassName)
 
#define VL_INSTRUMENT_ABSTRACT_BASE_CLASS(ClassName)
 
#define VL_INSTRUMENT_CLASS(ClassName, BaseClass)
 
#define VL_INSTRUMENT_ABSTRACT_CLASS(ClassName, BaseClass)
 
#define VL_INSTRUMENT_CLASS_2(ClassName, BaseClass1, BaseClass2)
 
#define VL_INSTRUMENT_ABSTRACT_CLASS_2(ClassName, BaseClass1, BaseClass2)
 

Functions

template<class B , class A >
B * vl::cast (A *obj)
 
template<class B , class A >
const B * vl::cast_const (const A *obj)
 

Detailed Description

Set of macros and templates implementing a simple and portable RTTI system.

Definition in file TypeInfo.hpp.

Macro Definition Documentation

◆ VL_GROUP

#define VL_GROUP (   ...)    __VA_ARGS__

Definition at line 77 of file TypeInfo.hpp.

◆ VL_INSTRUMENT_ABSTRACT_BASE_CLASS

#define VL_INSTRUMENT_ABSTRACT_BASE_CLASS (   ClassName)
Value:
public: \
/* static functions */ \ \
static const char* Name() { return VL_TO_STR(ClassName); } \ \
static const ::vl::TypeInfo& Type() { static const ::vl::TypeInfo class_type(VL_TO_STR(ClassName)); return class_type; } \
\
/* virtual functions */ \ \
virtual const char* className() const { return VL_TO_STR(ClassName); } \ \
virtual const ::vl::TypeInfo& classType() const { return Type(); } \ \
virtual bool isOfType(const ::vl::TypeInfo& type) const \
{ \
return type == Type(); \
} \
/* virtual Object* createThisType() const = 0; */ \
private:
#define VL_TO_STR(...)
Definition: TypeInfo.hpp:78

Definition at line 101 of file TypeInfo.hpp.

◆ VL_INSTRUMENT_ABSTRACT_CLASS

#define VL_INSTRUMENT_ABSTRACT_CLASS (   ClassName,
  BaseClass 
)
Value:
private: \
typedef BaseClass super; \
public: \
/* static functions */ \ \
static const char* Name() { return VL_TO_STR(ClassName); } \ \
static const ::vl::TypeInfo& Type() { static const ::vl::TypeInfo class_type(VL_TO_STR(ClassName)); return class_type; } \
\
/* virtual functions */ \ \
virtual const char* className() const { return VL_TO_STR(ClassName); } \ \
virtual const ::vl::TypeInfo& classType() const { return Type(); } \ \
virtual bool isOfType(const ::vl::TypeInfo& type) const \
{ \
return type == Type() || super::isOfType(type); \
} \
/* virtual Object* createThisType() const = 0; */ \
private:
#define VL_TO_STR(...)
Definition: TypeInfo.hpp:78

Definition at line 145 of file TypeInfo.hpp.

◆ VL_INSTRUMENT_ABSTRACT_CLASS_2

#define VL_INSTRUMENT_ABSTRACT_CLASS_2 (   ClassName,
  BaseClass1,
  BaseClass2 
)
Value:
private: \
typedef BaseClass1 super1; \
typedef BaseClass2 super2; \
public: \
/* static functions */ \ \
static const char* Name() { return VL_TO_STR(ClassName); } \ \
static const ::vl::TypeInfo& Type() { static const ::vl::TypeInfo class_type(VL_TO_STR(ClassName)); return class_type; } \
\
/* virtual functions */ \ \
virtual const char* className() const { return VL_TO_STR(ClassName); } \ \
virtual const ::vl::TypeInfo& classType() const { return Type(); } \ \
virtual bool isOfType(const ::vl::TypeInfo& type) const \
{ \
return type == Type() || super1::isOfType(type) || super2::isOfType(type); \
} \
/* virtual Object* createThisType() const = 0; */ \
private:
#define VL_TO_STR(...)
Definition: TypeInfo.hpp:78

Definition at line 192 of file TypeInfo.hpp.

◆ VL_INSTRUMENT_BASE_CLASS

#define VL_INSTRUMENT_BASE_CLASS (   ClassName)
Value:
public: \
/* static functions */ \ \
static const char* Name() { return VL_TO_STR(ClassName); } \ \
static const ::vl::TypeInfo& Type() { static const ::vl::TypeInfo class_type(VL_TO_STR(ClassName)); return class_type; } \
\
/* virtual functions */ \ \
virtual const char* className() const { return VL_TO_STR(ClassName); } \ \
virtual const ::vl::TypeInfo& classType() const { return Type(); } \ \
virtual bool isOfType(const ::vl::TypeInfo& type) const \
{ \
return type == Type(); \
} \
/* virtual Object* createThisType() const { return new ClassName; } */ \
private:
#define VL_TO_STR(...)
Definition: TypeInfo.hpp:78

Definition at line 80 of file TypeInfo.hpp.

◆ VL_INSTRUMENT_CLASS

#define VL_INSTRUMENT_CLASS (   ClassName,
  BaseClass 
)
Value:
private: \
typedef BaseClass super; \
public: \
/* static functions */ \ \
static const char* Name() { return VL_TO_STR(ClassName); } \ \
static const ::vl::TypeInfo& Type() { static const ::vl::TypeInfo class_type(VL_TO_STR(ClassName)); return class_type; } \
\
/* virtual functions */ \ \
virtual const char* className() const { return VL_TO_STR(ClassName); } \ \
virtual const ::vl::TypeInfo& classType() const { return Type(); } \ \
virtual bool isOfType(const ::vl::TypeInfo& type) const \
{ \
return type == Type() || super::isOfType(type); \
} \
/* virtual Object* createThisType() const { return new ClassName; } */ \
private:
#define VL_TO_STR(...)
Definition: TypeInfo.hpp:78

Definition at line 122 of file TypeInfo.hpp.

◆ VL_INSTRUMENT_CLASS_2

#define VL_INSTRUMENT_CLASS_2 (   ClassName,
  BaseClass1,
  BaseClass2 
)
Value:
private: \
typedef BaseClass1 super1; \
typedef BaseClass2 super2; \
public: \
/* static functions */ \ \
static const char* Name() { return VL_TO_STR(ClassName); } \ \
static const ::vl::TypeInfo& Type() { static const ::vl::TypeInfo class_type(VL_TO_STR(ClassName)); return class_type; } \
\
/* virtual functions */ \ \
virtual const char* className() const { return VL_TO_STR(ClassName); } \ \
virtual const ::vl::TypeInfo& classType() const { return Type(); } \ \
virtual bool isOfType(const ::vl::TypeInfo& type) const \
{ \
return type == Type() || super1::isOfType(type) || super2::isOfType(type); \
} \
/* virtual Object* createThisType() const { return new ClassName; } */ \
private:
#define VL_TO_STR(...)
Definition: TypeInfo.hpp:78

Definition at line 168 of file TypeInfo.hpp.

◆ VL_TO_STR

#define VL_TO_STR (   ...)    #__VA_ARGS__

Definition at line 78 of file TypeInfo.hpp.