Geogram  Version 1.9.1
A programming library of geometric algorithms
GEO::InstanceRepo Class Reference

Repository of unique instances. More...

#include <geogram/basic/factory.h>

Public Types

typedef Counted Instance
 Type of the Instances stored in the repository.
 

Static Public Member Functions

template<class InstanceType >
static InstanceType & instance ()
 Gets unique instance from the repository. More...
 

Detailed Description

Repository of unique instances.

InstanceRepo is the central point to access unique singleton instances using their type name. Instances are registered at their creation using function add() and retrieved using get().

Definition at line 69 of file factory.h.

Member Function Documentation

◆ instance()

template<class InstanceType >
static InstanceType& GEO::InstanceRepo::instance ( )
inlinestatic

Gets unique instance from the repository.

This function returns a unique instance of type InstanceType. If the instance is already registered in the repository, it is returned, otherwise a new instance is created and registered to the repository using the InstanceType name.

Template Parameters
InstanceTypetype of the instance
Returns
a pointer to a InstanceType unique instance.

Definition at line 86 of file factory.h.


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