This class stores metadata on a data field of a class. More...

#include <utils.h>

Inheritance diagram for frepple::utils::MetaCategory:

List of all members.

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 MetaClassfindClass (const char *) const
const MetaClassfindClass (const hashtype) const
 MetaCategory (const string &t, const string &g, readController=NULL, writeController=NULL)
virtual ~MetaCategory ()

Static Public Member Functions

static ObjectControllerDefault (const MetaClass *, const AttributeList &)
static const MetaCategoryfindCategoryByGroupTag (const char *)
static const MetaCategoryfindCategoryByGroupTag (const hashtype)
static const MetaCategoryfindCategoryByTag (const char *)
static const MetaCategoryfindCategoryByTag (const hashtype)
static void persist (XMLOutput *)

Public Attributes

string group
const Keywordgrouptag
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

Definition at line 1166 of file utils.h.


Member Typedef Documentation

Type definition for the map of all categories.

Definition at line 1199 of file utils.h.

Type definition for the map of all registered classes.

Definition at line 1196 of file utils.h.

Type definition for the read control function.

Definition at line 1178 of file utils.h.

Type definition for the write control function.

Definition at line 1181 of file utils.h.


Constructor & Destructor Documentation

virtual frepple::utils::MetaCategory::~MetaCategory ( ) [inline, virtual]

Destructor.

Definition at line 1189 of file utils.h.

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.

const MetaClass * frepple::utils::MetaCategory::findClass ( const hashtype  h) 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 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

friend class HasName [friend]

Definition at line 1169 of file utils.h.

friend class MetaClass [friend]

Definition at line 1168 of file utils.h.


Member Data Documentation

The name used to name a collection of objects of this category.

Definition at line 1172 of file utils.h.

A XML tag grouping objects of the category.

Definition at line 1175 of file utils.h.

A control function for reading objects of a category. The controller function manages the creation and destruction of objects in this category.

Definition at line 1237 of file utils.h.


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

Documentation generated for frePPLe by  doxygen