#include <Class.hpp>
Inheritance diagram for OMF::BasicClass< Type, Factory >:
Public Member Functions | |
virtual | ~BasicClass () |
Type * | create () |
void | destroy (Object *instance) |
virtual Object * | createInstance () |
virtual void | destroyInstance (Object *instance) |
const std::string & | name () const |
const OMF::Set & | allOfClass () const |
const OMF::Set & | allOfType () const |
void | addType (Object *type) |
void | removeType (Object *type) |
Static Public Member Functions | |
Self & | instance (const std::string &name="") |
Protected Member Functions | |
BasicClass () | |
Class & | init (const std::string &name) |
Protected Attributes | |
OMF::Set | _ofClass |
OMF::Set | _ofType |
|
|
|
|
|
The addType() method is used to register a new type instance with the class proxy. It should be called in the constructor of every interface class. |
|
Return all instances of this class (no subtypes). |
|
Return all instances of this type (with subtypes). |
|
This is the type specific factory method. If the class is not abstract, it will return a new instance of the type. This method also adds the object to the set of actual instances. |
|
This method is the derived implementation from the Class class. It simply calls create() to return a new instance or 0. Reimplemented from OMF::Class.
|
|
Ideally, this method is the "anti-factory". When a class is officially deleted, this method needs to be called to remove the class from the instance extent. Note that it doesn't actually delete the class. |
|
The destroyInstance() method essentially just removes the object reference from the instance set. It is only called from the decRef() method of ModelObject before the destructor chain is called. Reimplemented from OMF::Class.
|
|
Used for construction. |
|
The instance() method returns the singleton instance of the class proxy specific to the templated type. Note the oddness with the name parameter. The first initialization of this method must pass the name of the class to the constructor. |
|
Return the name of the class as the type code. |
|
The removeType() method is used to remove a type instance from the class proxy. It should be called in the destructor of every interface class. |
|
|
|
|