This class stores metadata on a data field of a class. More...
#include <utils.h>
Public Types | |
typedef map< hashtype, const MetaCategory *, less< hashtype > > | CategoryMap |
typedef map< hashtype, const MetaClass *, less< hashtype > > | ClassMap |
typedef Object *(* | readController )(const MetaClass *, const AttributeList &) |
typedef void(* | writeController )(const MetaCategory *, XMLOutput *o) |
![]() | |
typedef Object *(* | creatorDefault )() |
typedef Object *(* | creatorString )(const string &) |
Public Member Functions | |
const MetaClass * | findClass (const char *) const |
const MetaClass * | findClass (const hashtype) const |
MetaCategory (const string &t, const string &g, readController=NULL, writeController=NULL) | |
virtual | ~MetaCategory () |
![]() | |
void | connect (Functor *c, Signal a) const |
void | disconnect (Functor *c, Signal a) const |
MetaClass (const string &cat, const string &cls, bool def=false) | |
MetaClass (const string &cat, const string &cls, creatorDefault f, bool def=false) | |
MetaClass (const string &cat, const string &cls, creatorString f, bool def=false) | |
MetaClass () | |
bool | operator!= (const MetaClass &b) const |
bool | operator< (const MetaClass &b) const |
bool | operator== (const MetaClass &b) const |
bool | raiseEvent (Object *v, Signal a) const |
void | registerClass (const string &, const string &, bool=false, creatorDefault=NULL) |
virtual | ~MetaClass () |
Static Public Member Functions | |
static Object * | ControllerDefault (const MetaClass *, const AttributeList &) |
static const MetaCategory * | findCategoryByGroupTag (const char *) |
static const MetaCategory * | findCategoryByGroupTag (const hashtype) |
static const MetaCategory * | findCategoryByTag (const char *) |
static const MetaCategory * | findCategoryByTag (const hashtype) |
static void | persist (XMLOutput *) |
![]() | |
static Action | decodeAction (const char *) |
static Action | decodeAction (const AttributeList &) |
static const MetaClass * | findClass (const char *) |
static void | printClasses () |
Public Attributes | |
string | group |
const Keyword * | grouptag |
readController | readFunction |
![]() | |
union { | |
creatorDefault factoryMethodDefault | |
creatorString factoryMethodString | |
}; | |
const MetaCategory * | category |
PyTypeObject * | pythonClass |
string | type |
const Keyword * | typetag |
Friends | |
class | HasName |
class | MetaClass |
This class stores metadata on a data field of a class.
A field Constructor. A MetaCategory instance represents metadata for a category of object.
A MetaClass instance represents metadata for a specific instance type. For instance, 'Resource' is a category while 'ResourceDefault' and 'ResourceInfinite' are specific classes.
A category has the following specific pieces of data:
typedef map< hashtype, const MetaCategory*, less<hashtype> > frepple::utils::MetaCategory::CategoryMap |
typedef map< hashtype, const MetaClass*, less<hashtype> > frepple::utils::MetaCategory::ClassMap |
typedef Object*(* frepple::utils::MetaCategory::readController)(const MetaClass *, const AttributeList &) |
typedef void(* frepple::utils::MetaCategory::writeController)(const MetaCategory *, XMLOutput *o) |
|
inlinevirtual |
frepple::utils::MetaCategory::MetaCategory | ( | const string & | t, |
const string & | g, | ||
readController | f = NULL , |
||
writeController | w = NULL |
||
) |
Constructor.
Definition at line 339 of file utils/library.cpp.
|
static |
This template method is available as a object creation factory for classes without key fields and which rely on a default constructor.
Definition at line 496 of file utils/library.cpp.
|
static |
Looks up a category name in the registry. If the catgory can't be located the return value is NULL.
Definition at line 383 of file utils/library.cpp.
|
static |
Looks up a category name in the registry. If the category can't be located the return value is NULL.
Definition at line 391 of file utils/library.cpp.
|
static |
Looks up a category name in the registry. If the catgory can't be located the return value is NULL.
Definition at line 367 of file utils/library.cpp.
|
static |
Looks up a category name in the registry. If the catgory can't be located the return value is NULL.
Definition at line 375 of file utils/library.cpp.
const MetaClass * frepple::utils::MetaCategory::findClass | ( | const char * | c | ) | const |
Find a class in this category with a specified name.
If the catrgory can't be found the return value is NULL.
Definition at line 399 of file utils/library.cpp.
Find a class in this category with a specified name.
If the catrgory can't be found the return value is NULL.
Definition at line 407 of file utils/library.cpp.
|
static |
This method takes care of the persistence of all categories. It loops through all registered categories (in the order of their registration) and calls the persistance handler.
Definition at line 415 of file utils/library.cpp.
string frepple::utils::MetaCategory::group |
const Keyword* frepple::utils::MetaCategory::grouptag |
readController frepple::utils::MetaCategory::readFunction |