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) |
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 () |
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 *) |
Public Attributes | |
string | group |
const Keyword * | grouptag |
readController | readFunction |
Friends | |
class | HasName |
class | MetaClass |
Detailed Description
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:
- A reader function for creating objects.
The reader function creates objects for all classes registered with it. - A writer function for persisting objects.
The writer function will typically iterate over all objects of the category and call the writeElement method on them. - A group tag used for the grouping objects of the category in the XML output stream.
- See also:
- MetaClass
Member Typedef Documentation
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) |
Constructor & Destructor Documentation
virtual frepple::utils::MetaCategory::~MetaCategory | ( | ) | [inline, virtual] |
frepple::utils::MetaCategory::MetaCategory | ( | const string & | t, |
const string & | g, | ||
readController | f = NULL , |
||
writeController | w = NULL |
||
) |
Constructor.
Definition at line 345 of file utils/library.cpp.
Member Function Documentation
Object * frepple::utils::MetaCategory::ControllerDefault | ( | const MetaClass * | cat, |
const AttributeList & | in | ||
) | [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 502 of file utils/library.cpp.
const MetaCategory * frepple::utils::MetaCategory::findCategoryByGroupTag | ( | const char * | c | ) | [static] |
Looks up a category name in the registry. If the catgory can't be located the return value is NULL.
Definition at line 389 of file utils/library.cpp.
const MetaCategory * frepple::utils::MetaCategory::findCategoryByGroupTag | ( | const hashtype | h | ) | [static] |
Looks up a category name in the registry. If the category can't be located the return value is NULL.
Definition at line 397 of file utils/library.cpp.
const MetaCategory * frepple::utils::MetaCategory::findCategoryByTag | ( | const char * | c | ) | [static] |
Looks up a category name in the registry. If the catgory can't be located the return value is NULL.
Definition at line 373 of file utils/library.cpp.
const MetaCategory * frepple::utils::MetaCategory::findCategoryByTag | ( | const hashtype | h | ) | [static] |
Looks up a category name in the registry. If the catgory can't be located the return value is NULL.
Definition at line 381 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 405 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 413 of file utils/library.cpp.
void frepple::utils::MetaCategory::persist | ( | XMLOutput * | o | ) | [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 421 of file utils/library.cpp.
Friends And Related Function Documentation
Member Data Documentation
The documentation for this class was generated from the following files:
Documentation generated for frePPLe by
