Graphite  Version 3
An experimental 3D geometry processing program
GEO::Factory1< Type, Param1 > Class Template Reference

Factory for types with one constructor argument. More...

#include <geogram/basic/factory.h>

Inheritance diagram for GEO::Factory1< Type, Param1 >:
GEO::Factory< FactoryCreator1< Type, Param1 > > GEO::Counted

Static Public Member Functions

static Type * create_object (const std::string &name, const Param1 &param1)
 Creates a new object with parameter(s). More...
 
- Static Public Member Functions inherited from GEO::Factory< FactoryCreator1< Type, Param1 > >
static void register_creator (const std::string &name)
 Registers a creator. More...
 
static CreatorType find_creator (const std::string &name)
 Finds a creator by name. More...
 
static void list_creators (std::vector< std::string > &names)
 Lists all registered creators. More...
 
static bool has_creator (const std::string &name)
 Tests whether the factory has a creator. More...
 
- Static Public Member Functions inherited from GEO::Counted
static void ref (const Counted *counted)
 Increments the reference count. More...
 
static void unref (const Counted *counted)
 Decrements the reference count. More...
 

Additional Inherited Members

- Public Types inherited from GEO::Factory< FactoryCreator1< Type, Param1 > >
typedef FactoryCreator::CreatorType CreatorType
 
- Public Member Functions inherited from GEO::Counted
void ref () const
 Increments the reference count. More...
 
void unref () const
 Decrements the reference count. More...
 
bool is_shared () const
 Check if the object is shared. More...
 
int nb_refs () const
 Gets the number of references that point to this object. More...
 
- Protected Member Functions inherited from GEO::Factory< FactoryCreator1< Type, Param1 > >
 ~Factory () override
 Factory destructor.
 
- Protected Member Functions inherited from GEO::Counted
 Counted ()
 Creates a reference counted object. More...
 
virtual ~Counted ()
 Destroys a reference counted object. More...
 

Detailed Description

template<class Type, class Param1>
class GEO::Factory1< Type, Param1 >

Factory for types with one constructor argument.

This implements a Factory to create objects with no constructor arguments.

Template Parameters
Typebase type of the created objects
Param1type of the constructor argument
See also
FactoryCreator1

Definition at line 345 of file factory.h.

Member Function Documentation

◆ create_object()

template<class Type , class Param1 >
static Type* GEO::Factory1< Type, Param1 >::create_object ( const std::string &  name,
const Param1 &  param1 
)
inlinestatic

Creates a new object with parameter(s).

This creates a new object using the creator function bound to the specified user-defined name.

Parameters
[in]namespecifies which kind of object to create
[in]param1parameter passed to the object constructor
Return values
apointer to a new object is name is associated to a creator in this Factory
anull pointer otherwise.

Definition at line 359 of file factory.h.


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