#include <coherence/lang/Class.hpp>
Inherits Object.
Inherited by TypedBarrenClass, and TypedClass.
Not all managed classes may have a corresponding Class representation. Classes are referred to via their demangled RTTI name, for example coherence::lang::Object.
Classes can be loaded by name via a ClassLoader.
Public Types | ||||
| typedef spec::Handle | Handle | |||
| Class Handle definition. | ||||
| typedef spec::View | View | |||
| Class View definition. | ||||
| typedef spec::Holder | Holder | |||
| Class Holder definition. | ||||
Public Member Functions | ||||
| String::View | getName () const | |||
| Return the name of the class. | ||||
| virtual Object::Handle | newInstance (ObjectArray::View vaParam=NULL) const =0 | |||
| Create a new instance of the corresponding type. | ||||
| virtual const std::type_info & | getTypeInfo () const =0 | |||
| Return the typeinfo for the corresponding type. | ||||
| virtual size32_t | getSize () const =0 | |||
| Return the shallow size for an instance of the class represented by this Class. | ||||
| virtual bool | equals (Object::View that) const | |||
| Return true iff the specified Object is "equal" to this Object. This method implements an equivalence relation on Objects:
The default implementation is a reference equality comparison.
| ||||
| virtual size32_t | hashCode () const | |||
| Return a hash code value for the Object. This method is supported for the benefit of hash-based containers.
The general contract of
The default implementation is identity based.
| ||||
Static Public Member Functions | ||||
| static String::View | getClassName (Object::View v) | |||
| Return the class name of the supplied Object. | ||||
| static String::View | getTypeName (const std::type_info &info) | |||
| Return the type name of the supplied Object. | ||||
Protected Member Functions | ||||
| Class (const std::type_info &info) | ||||
| Construct a class based on a C++ type_info. | ||||
| Class | ( | const std::type_info & | info | ) | [protected] |
Construct a class based on a C++ type_info.
| info | the type_info for the class represented by this Class. |
| String::View getName | ( | ) | const |
Return the name of the class.
| virtual Object::Handle newInstance | ( | ObjectArray::View | vaParam = NULL |
) | const [pure virtual] |
Create a new instance of the corresponding type.
| vaParam | the object's initialization parameters |
Implemented in TypedBarrenClass, and TypedClass.
| virtual const std::type_info& getTypeInfo | ( | ) | const [pure virtual] |
Return the typeinfo for the corresponding type.
Implemented in TypedBarrenClass, and TypedClass.
| virtual size32_t getSize | ( | ) | const [pure virtual] |
Return the shallow size for an instance of the class represented by this Class.
Implemented in TypedBarrenClass, and TypedClass.
| static String::View getClassName | ( | Object::View | v | ) | [static] |
| static String::View getTypeName | ( | const std::type_info & | info | ) | [static] |
Return the type name of the supplied Object.
| info | the type id for which to obtain the type name |