* Rewrote headers as necessary; only Errors.h and Debug.h still originate from a Be header now;
feel free to change that ;-) * Cleaned up existing headers. * Coding style guide update to BBufferIO (renamed m_* members to f*). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19972 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,38 +1,24 @@
|
||||
/******************************************************************************
|
||||
/
|
||||
/ File: ClassInfo.h
|
||||
/
|
||||
/ Description: C++ class identification and casting macros
|
||||
/
|
||||
/ Copyright 1993-98, Be Incorporated
|
||||
/
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright 2007, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _CLASS_INFO_H
|
||||
#define _CLASS_INFO_H
|
||||
|
||||
|
||||
#include <typeinfo>
|
||||
|
||||
|
||||
// deprecated, use standard RTTI calls instead
|
||||
// TODO: maybe get rid of this header completely?
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
namespace OpenBeOS {
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*--------- Class Info Macros ---------------------------------*/
|
||||
|
||||
#define class_name(ptr) ((typeid(*(ptr))).name())
|
||||
#define cast_as(ptr, class) (dynamic_cast<class*>(ptr))
|
||||
#define is_kind_of(ptr, class) (cast_as(ptr, class) != 0)
|
||||
#define is_instance_of(ptr, class) (typeid(*(ptr)) == typeid(class))
|
||||
#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))
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
/*-------------------------------------------------------------*/
|
||||
|
||||
#ifdef USE_OPENBEOS_NAMESPACE
|
||||
} // namespace OpenBeOS
|
||||
using namespace OpenBeOS;
|
||||
#endif
|
||||
|
||||
#endif /* _CLASS_INFO_H */
|
||||
#endif // _CLASS_INFO_H
|
||||
|
||||
Reference in New Issue
Block a user