last update 20 Sep 2009 |
#include "cvrObject.h"
#include "cvrClassName.h"
#include "cvrMacroSymbols.h"
#include "cvrFactoryReferences.h"
#include <map>
#include <string>
#include <typeinfo>
#include "cvrFactory_template.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) |
#define _CVR_REGISTER_IN_FACTORY | ( | BASE, | |||
CLASS | ) |
Value:
factory<BASE>::registration<CLASS> \ _CVR_FACTORY_REGISTRATION_ ## BASE ## _ ## CLASS ## _;
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);
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);
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 ##;
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);