PTLib
Version 2.14.3
|
#include <ptlib.h>
#include <typeinfo>
#include <string>
#include <map>
#include <vector>
Go to the source code of this file.
Classes | |
class | PFactoryBase |
Base class for generic factories. More... | |
class | PFactoryBase::FactoryMap |
class | PFactoryTemplate< AbstractClass, ParamType, KeyType > |
Template class for generic factories of an abstract class. More... | |
class | PFactoryTemplate< AbstractClass, ParamType, KeyType >::WorkerBase |
class | PFactory< AbstractClass, KeyType > |
Class for a factory to create concrete class instances without parameters during construction. More... | |
class | PFactory< AbstractClass, KeyType >::Worker< ConcreteClass > |
class | PParamFactory< AbstractClass, ParamType, KeyType > |
Class for a factory to create concrete class instances which have a single parameter during construction. More... | |
class | PParamFactory< AbstractClass, ParamType, KeyType >::Worker< ConcreteClass > |
Macros | |
#define | PFACTORY_STATICS(cls) |
#define | PFACTORY_CREATE(factory, ConcreteClass,...) |
This macro is used to create a factory. More... | |
#define | PFACTORY_SYNONYM(factory, ConcreteClass, name, key) |
#define | PFACTORY_CREATE_SINGLETON(factory, ConcreteClass) PFACTORY_CREATE(factory, ConcreteClass, typeid(ConcreteClass).name(), true) |
#define | PFACTORY_GET_SINGLETON(factory, ConcreteClass) |
#define | PFACTORY_LOAD(ConcreteType) |
Typedefs | |
typedef std::string | PDefaultPFactoryKey |
this define the default class to be used for keys into PFactories More... | |
#define PFACTORY_CREATE | ( | factory, | |
ConcreteClass, | |||
... | |||
) |
This macro is used to create a factory.
This is mainly used for factories that exist inside a library and works in conjunction with the PFACTORY_LOAD() macro.
When a factory is contained wholly within a single compilation module of a library, it is typical that a linker does not include ANY of the code in that module. To avoid this the header file that declares the abstract type should include a PFACTORY_LOAD() macro call for all concrete classes that are in the library. Then whan an application includes the abstract types header, it will force the load of all the possible concrete classes.
#define PFACTORY_CREATE_SINGLETON | ( | factory, | |
ConcreteClass | |||
) | PFACTORY_CREATE(factory, ConcreteClass, typeid(ConcreteClass).name(), true) |
#define PFACTORY_GET_SINGLETON | ( | factory, | |
ConcreteClass | |||
) |
#define PFACTORY_LOAD | ( | ConcreteType | ) |
#define PFACTORY_STATICS | ( | cls | ) |
#define PFACTORY_SYNONYM | ( | factory, | |
ConcreteClass, | |||
name, | |||
key | |||
) |
typedef std::string PDefaultPFactoryKey |
this define the default class to be used for keys into PFactories