Graphite
Version 3
An experimental 3D geometry processing program
|
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... | |
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().
|
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.
InstanceType | type of the instance |
InstanceType
unique instance.