CVR-Lib last update 20 Sep 2009

cvrFactory.h File Reference

Contains the template type for CVR-Lib factories. More...

#include "cvrObject.h"
#include "cvrClassName.h"
#include "cvrMacroSymbols.h"
#include "cvrFactoryReferences.h"
#include <map>
#include <string>
#include <typeinfo>
#include "cvrFactory_template.h"

Include dependency graph for cvrFactory.h:

Go to the source code of this file.

Classes

class  cvr::factory< T >
 Factory of objects of base type T. More...
class  cvr::factory< T >::factory::registration< U >
 Represents the registration of an object of type U, constructed with the default parameterless constructor, and under its class name. More...

Namespaces

namespace  cvr

Defines

#define _CVR_REGISTER_IN_FACTORY(BASE, CLASS)
#define _CVR_REGISTER_IN_TEMPLATE_FACTORY(TYPE, BASE, CLASS)
#define _CVR_REGISTER_IN_FACTORY_AS(NAME, BASE, CLASS)
#define _CVR_REGISTER_IN_FACTORY_AS_VAR(NAME, BASE, CLASS, VAR)


Detailed Description

Contains the template type for CVR-Lib factories.

Author:
Gustavo Quiros
Date:
08.07.2004
$Id:

Define Documentation

#define _CVR_REGISTER_IN_FACTORY ( BASE,
CLASS   ) 

Value:

factory<BASE>::registration<CLASS> \
_CVR_FACTORY_REGISTRATION_ ## BASE ## _ ## CLASS ## _;
Helper macro to register a class in a factory at compile time.

It must be used in a global context (outside of any function or class), and should be compiled only once, which means this must be in your .cpp file and never in a header!

Some scripts parse these entries in the cpp files of the library sources, so please ensure that your registration occupies only one line. You can use this macro in your own code with no restrictions.

Usage: _CVR_REGISTER_IN_FACTORY("base class name","class name"); Example: _CVR_REGISTER_IN_FACTORY(cvr::object,cvr::derived);

#define _CVR_REGISTER_IN_FACTORY_AS ( NAME,
BASE,
CLASS   ) 

Value:

factory<BASE>::registration<CLASS> \
_CVR_FACTORY_REGISTRATION_ ## NAME ## _ ## BASE ## _ ## CLASS ## _(# NAME);
Helper macro to register a class in a factory at compile time, under a given name.

It must be used in a global context (outside of any function or class), and should be compiled only once, which means this must be in your .cpp file and never in a header!

Some scripts parse these entries in the cpp files of the library sources, so please ensure that your registration occupies only one line. You can use this macro in your own code with no restrictions.

The given name must not contain spaces, and you give it without any quotes.

Usage: _CVR_REGISTER_IN_FACTORY_AS("base class name","class name"); Example: _CVR_REGISTER_IN_FACTORY_AS(object,cvr::object,cvr::derived);

#define _CVR_REGISTER_IN_FACTORY_AS_VAR ( NAME,
BASE,
CLASS,
VAR   ) 

Value:

factory<BASE>::registration<CLASS> \
_CVR_FACTORY_REGISTRATION_ ## VAR ## _(# NAME);
Helper macro to register a class in a factory at compile time, under a given name.

It must be used in a global context (outside of any function or class), and should be compiled only once, which means this must be in your .cpp file and never in a header!

This macro allows to provide a name for the static variable, in those cases where nested classes, template classes or other type of classes do not allow an automatic generation of the name

Some scripts parse these entries in the cpp files of the library sources, so please ensure that your registration occupies only one line. You can use this macro in your own code with no restrictions.

The given name must not contain spaces, and you give it without any quotes.

Usage: _CVR_REGISTER_IN_FACTORY_AS("base class name","class name"); Example: _CVR_REGISTER_IN_FACTORY_AS(object,cvr::object,cvr::derived);

#define _CVR_REGISTER_IN_TEMPLATE_FACTORY ( TYPE,
BASE,
CLASS   ) 

Value:

factory< BASE<TYPE> >::registration< CLASS<TYPE> > \
_CVR_FACTORY_REGISTRATION_ ## BASE ## _ ## CLASS ## _ ## TYPE ##;
Helper macro to register a class in a factory at compile time, where the base class and the inherited one are both templates of a given type.

It must be used in a global context (outside of any function or class), and should be compiled only once, which means this must be in your .cpp file and never in a header!

Some scripts parse these entries in the cpp files of the library sources, so please ensure that your registration occupies only one line. You can use this macro in your own code with no restrictions.

Usage: _CVR_REGISTER_IN_TEMPLATE_FACTORY("template type", "base class name","class name"); Example: _CVR_REGISTER_IN_FACTORY(float,cvr::parent,cvr::derived);


Generated on Sun Sep 20 22:08:07 2009 for CVR-Lib by Doxygen 1.5.8