JX Application Framework
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
JRTTIBase Class Reference

#include <JRTTIBase.h>

Inheritance diagram for JRTTIBase:
[legend]

Public Member Functions

virtual ~JRTTIBase ()
 
bool Is (const JUtf8Byte *type) const
 
const JUtf8ByteGetType () const
 

Protected Member Functions

 JRTTIBase (const JUtf8Byte *type)
 

Detailed Description

Base class for all errors

Base class for all objects that need RTTI.

Each derived class must provide a unique string as its type.  The best
way to ensure uniqueness is to build the string "<class name>::<owner
name>".  To help avoid typos, define this string as a static class
constant so clients can use this constant instead of the actual string.
If they mistype the constant, the compiler will complain.  If they
mistype the string, it will be a very subtle bug.  In addition, using
the constant makes Is() much faster.

This was built long before compiler support for RTTI support was
stable.  We could replace it with std::type_info, but since Is()
already does a pointer comparison, there is no speed benefit, and the
reduction in static data would be negligible.

Constructor & Destructor Documentation

◆ ~JRTTIBase()

JRTTIBase::~JRTTIBase ( )
virtual

◆ JRTTIBase()

JRTTIBase::JRTTIBase ( const JUtf8Byte type)
inlineprotected

Member Function Documentation

◆ GetType()

const JUtf8Byte * JRTTIBase::GetType ( ) const
inline

◆ Is()

bool JRTTIBase::Is ( const JUtf8Byte type) const

Returns true if we are of the given type.


The documentation for this class was generated from the following files: