Visualization Library v1.0.3

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

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Classes | Namespaces | Defines | Functions

/home/master/UCL/VisualizationLibrary/src/vlCore/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

namespace  vl
 

Visualization Library namespace.


Defines

#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.


Define Documentation

#define VL_GROUP (   ... )    __VA_ARGS__

Definition at line 77 of file TypeInfo.hpp.

#define VL_TO_STR (   ... )    #__VA_ARGS__

Definition at line 78 of file TypeInfo.hpp.

#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:

Definition at line 80 of file TypeInfo.hpp.

#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:

Definition at line 101 of file TypeInfo.hpp.

#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:

Definition at line 122 of file TypeInfo.hpp.

#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:

Definition at line 145 of file TypeInfo.hpp.

#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:

Definition at line 168 of file TypeInfo.hpp.

#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:

Definition at line 192 of file TypeInfo.hpp.


Visualization Library v1.0.3 Reference Documentation
Copyright Michele Bosi. All rights reserved.
Updated on Tue Feb 7 2017 00:55:04.
Permission is granted to use this page to write and publish articles regarding Visualization Library.