Geogram  Version 1.9.1-rc
A programming library of geometric algorithms
GEO::Factory0< Type > Class Template Reference

Factory for types without constructor arguments. More...

#include <geogram/basic/factory.h>

Inheritance diagram for GEO::Factory0< Type >:
GEO::Factory< FactoryCreator0< Type > > GEO::Counted

Static Public Member Functions

static Type * create_object (const std::string &name)
 Creates a new object. More...
 
- Static Public Member Functions inherited from GEO::Factory< FactoryCreator0< Type > >
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< FactoryCreator0< Type > >
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< FactoryCreator0< Type > >
 ~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 GEO::Factory0< Type >

Factory for types without constructor arguments.

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

Template Parameters
Typebase type of the created objects
See also
FactoryCreator

Definition at line 292 of file factory.h.

Member Function Documentation

◆ create_object()

template<class Type >
static Type* GEO::Factory0< Type >::create_object ( const std::string &  name)
inlinestatic

Creates a new object.

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

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

Definition at line 305 of file factory.h.


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