frepple::utils::MetaCategory Class Reference

A MetaCategory instance represents metadata for a category of object. More...

#include <utils.h>

Inheritance diagram for frepple::utils::MetaCategory:
frepple::utils::MetaClass frepple::utils::NonCopyable

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 hashtype) const
const MetaClassfindClass (const char *) 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 hashtype)
static const MetaCategoryfindCategoryByGroupTag (const char *)
static const MetaCategoryfindCategoryByTag (const hashtype)
static const MetaCategoryfindCategoryByTag (const char *)
static void persist (XMLOutput *)

Public Attributes

string group
const Keywordgrouptag
readController readFunction

Friends

class HasName
class MetaClass

Detailed Description

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:

Definition at line 1187 of file utils.h.


Member Typedef Documentation

Type definition for the map of all categories.

Definition at line 1220 of file utils.h.

Type definition for the map of all registered classes.

Definition at line 1217 of file utils.h.

Type definition for the read control function.

Definition at line 1199 of file utils.h.

Type definition for the write control function.

Definition at line 1202 of file utils.h.


Constructor & Destructor Documentation

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

Destructor.

Definition at line 1210 of file utils.h.

frepple::utils::MetaCategory::MetaCategory ( const string &  t,
const string &  g,
readController  f = NULL,
writeController  w = NULL 
)

Constructor.

Definition at line 248 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 405 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 300 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 292 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 284 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 276 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 316 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 308 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 324 of file utils/library.cpp.


Friends And Related Function Documentation

friend class HasName [friend]

Definition at line 1190 of file utils.h.

friend class MetaClass [friend]

Definition at line 1189 of file utils.h.


Member Data Documentation

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

Definition at line 1193 of file utils.h.

A XML tag grouping objects of the category.

Definition at line 1196 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 1258 of file utils.h.


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

Generated on 25 Feb 2010 for frePPLe by  doxygen 1.6.1