2007-01-26 19:36:29 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2002-07-09 16:24:59 +04:00
|
|
|
#ifndef _CLASS_INFO_H
|
|
|
|
#define _CLASS_INFO_H
|
|
|
|
|
|
|
|
|
2007-01-26 19:36:29 +03:00
|
|
|
#include <typeinfo>
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
|
2007-01-26 19:36:29 +03:00
|
|
|
// deprecated, use standard RTTI calls instead
|
|
|
|
// TODO: maybe get rid of this header completely?
|
|
|
|
|
|
|
|
#define class_name(object) \
|
|
|
|
((typeid(*(object))).name())
|
|
|
|
#define cast_as(object, class) \
|
|
|
|
(dynamic_cast<class*>(object))
|
|
|
|
#define is_kind_of(object, class) \
|
|
|
|
(dynamic_cast<class*>(object) != NULL)
|
|
|
|
#define is_instance_of(object, class) \
|
|
|
|
(typeid(*(object)) == typeid(class))
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2007-01-26 19:36:29 +03:00
|
|
|
#endif // _CLASS_INFO_H
|