# Visualization Library

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

[Home] [Tutorials] [All Classes] [Grouped Classes]

Classes | Namespaces | Defines | Functions

# D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/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 TypeInfo& Type() { static const TypeInfo class_type(VL_TO_STR(ClassName)); return class_type; }        \
                                                                                                                          \
      /* virtual functions */                                                                                             \                                                                      \
      virtual const char* className() const { return VL_TO_STR(ClassName); }                                              \                                                                  \
      virtual const TypeInfo& classType() const { return Type(); }                                                        \                                                  \
      virtual bool isOfType(const 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 TypeInfo& Type() { static const TypeInfo class_type(VL_TO_STR(ClassName)); return class_type; }        \
                                                                                                                          \
      /* virtual functions */                                                                                             \                                                                      \
      virtual const char* className() const { return VL_TO_STR(ClassName); }                                              \                                                                  \
      virtual const TypeInfo& classType() const { return Type(); }                                                        \                                                  \
      virtual bool isOfType(const 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 TypeInfo& Type() { static const TypeInfo class_type(VL_TO_STR(ClassName)); return class_type; }        \
                                                                                                                          \
      /* virtual functions */                                                                                             \                                                                      \
      virtual const char* className() const { return VL_TO_STR(ClassName); }                                              \                                                                  \
      virtual const TypeInfo& classType() const { return Type(); }                                                        \                                                  \
      virtual bool isOfType(const 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 TypeInfo& Type() { static const TypeInfo class_type(VL_TO_STR(ClassName)); return class_type; }        \
                                                                                                                          \
      /* virtual functions */                                                                                             \                                                                      \
      virtual const char* className() const { return VL_TO_STR(ClassName); }                                              \                                                                  \
      virtual const TypeInfo& classType() const { return Type(); }                                                        \                                                  \
      virtual bool isOfType(const 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 TypeInfo& Type() { static const TypeInfo class_type(VL_TO_STR(ClassName)); return class_type; }        \
                                                                                                                          \
      /* virtual functions */                                                                                             \                                                                      \
      virtual const char* className() const { return VL_TO_STR(ClassName); }                                              \                                                                  \
      virtual const TypeInfo& classType() const { return Type(); }                                                        \                                                  \
      virtual bool isOfType(const 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 TypeInfo& Type() { static const TypeInfo class_type(VL_TO_STR(ClassName)); return class_type; }        \
                                                                                                                          \
      /* virtual functions */                                                                                             \                                                                      \
      virtual const char* className() const { return VL_TO_STR(ClassName); }                                              \                                                                  \
      virtual const TypeInfo& classType() const { return Type(); }                                                        \                                                  \
      virtual bool isOfType(const 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 v2011.09.1162 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu Jan 26 2012 00:43:49.
Permission is granted to use this page to write and publish articles regarding Visualization Library.