Geogram  Version 1.9.1-rc
A programming library of geometric algorithms
GEO::Factory< FactoryCreator >::RegisterCreator< ConcreteType > Struct Template Reference

Helper class to register a creator. More...

#include <geogram/basic/factory.h>

Public Member Functions

 RegisterCreator (const std::string &name)
 Constructs a registration object. More...
 

Detailed Description

template<class FactoryCreator>
template<class ConcreteType>
struct GEO::Factory< FactoryCreator >::RegisterCreator< ConcreteType >

Helper class to register a creator.

Declaring a static instance of this class with appropriate parameters allows to register creators to the Factory at program initialization, thus making them available before the program actually starts.

Template Parameters
ConcreteTypethe type of the objects to create
Usage example:
struct MyBaseClass { ... };
typedef Factory<MyBaseClass> MyFactory;
struct MyDerivedClass : MyBaseClass { ... };
static MyFactory::RegisterCreator<MyDerivedClass>
register_derived("my_derived_class");
See also
geo_register_creator()

Definition at line 225 of file factory.h.

Constructor & Destructor Documentation

◆ RegisterCreator()

template<class FactoryCreator >
template<class ConcreteType >
GEO::Factory< FactoryCreator >::RegisterCreator< ConcreteType >::RegisterCreator ( const std::string &  name)
inline

Constructs a registration object.

The constructor calls register_creator() to register a ConcreteType creator bound to name name.

Parameters
[in]namename of the ConcreteType creator in the Factory
See also
Factory::register_creator()

Definition at line 233 of file factory.h.


The documentation for this struct was generated from the following file: