SFCGAL  2.3.0
Public Types | Public Member Functions | Static Public Member Functions | List of all members
SFCGAL::tools::Registry Class Reference

Registry for dynamic information about SFCGAL library. More...

#include <Registry.h>

Public Types

using prototype_iterator = DereferenceIterator< std::vector< std::unique_ptr< Geometry >>>::iterator
 Iterator type for prototypes. More...
 
using const_prototype_iterator = DereferenceIterator< std::vector< std::unique_ptr< Geometry >>>::const_iterator
 Const iterator type for prototypes. More...
 

Public Member Functions

 ~Registry ()=default
 destructor More...
 
 Registry (const Registry &)=delete
 
auto operator= (const Registry &) -> Registry &=delete
 
void addPrototype (const Geometry &g)
 Register a new Geometry type. More...
 
std::vector< std::string > getGeometryTypes () const
 Returns the list of the geometry types. More...
 
auto newGeometryByTypeName (const std::string &geometryTypeName) const -> std::unique_ptr< Geometry >
 Returns a new instance of the given geometryTypeName. More...
 
auto newGeometryByTypeId (int typeId) const -> std::unique_ptr< Geometry >
 Returns a new instance of the given geometryType. More...
 
auto begin () -> prototype_iterator
 Returns a mutable iterator to the beginning of the registry collection. More...
 
auto begin () const -> const_prototype_iterator
 Returns a const iterator to the beginning of the registry collection. More...
 
auto end () -> prototype_iterator
 Returns a mutable iterator to the end of the registry collection. More...
 
auto end () const -> const_prototype_iterator
 Returns a const iterator to the end of the registry collection. More...
 

Static Public Member Functions

static Registry & instance ()
 Returns the instance of the registry. More...
 

Detailed Description

Registry for dynamic information about SFCGAL library.

Member Typedef Documentation

using SFCGAL::tools::Registry::const_prototype_iterator = DereferenceIterator<std::vector<std::unique_ptr<Geometry>>>:: const_iterator

Const iterator type for prototypes.

using SFCGAL::tools::Registry::prototype_iterator = DereferenceIterator<std::vector<std::unique_ptr<Geometry>>>:: iterator

Iterator type for prototypes.

Constructor & Destructor Documentation

SFCGAL::tools::Registry::~Registry ( )
default

destructor

SFCGAL::tools::Registry::Registry ( const Registry &  )
delete

Member Function Documentation

void SFCGAL::tools::Registry::addPrototype ( const Geometry &  g)

Register a new Geometry type.

Parameters
gThe geometry prototype to register
auto SFCGAL::tools::Registry::begin ( ) -> prototype_iterator
inline

Returns a mutable iterator to the beginning of the registry collection.

Returns
prototype_iterator Iterator to the first element.
auto SFCGAL::tools::Registry::begin ( ) const -> const_prototype_iterator
inline

Returns a const iterator to the beginning of the registry collection.

Returns
const_prototype_iterator Const iterator to the first element.
auto SFCGAL::tools::Registry::end ( ) -> prototype_iterator
inline

Returns a mutable iterator to the end of the registry collection.

Returns
prototype_iterator Iterator pointing past the last element.
auto SFCGAL::tools::Registry::end ( ) const -> const_prototype_iterator
inline

Returns a const iterator to the end of the registry collection.

Returns
const_prototype_iterator Const iterator pointing past the last element.
auto SFCGAL::tools::Registry::getGeometryTypes ( ) const

Returns the list of the geometry types.

Returns
Vector of geometry type names
auto SFCGAL::tools::Registry::instance ( )
static

Returns the instance of the registry.

Returns
Reference to the singleton registry instance
auto SFCGAL::tools::Registry::newGeometryByTypeId ( int  typeId) const -> std::unique_ptr<Geometry>

Returns a new instance of the given geometryType.

Parameters
typeIdThe geometry type ID
Returns
Pointer to new geometry instance
auto SFCGAL::tools::Registry::newGeometryByTypeName ( const std::string &  geometryTypeName) const -> std::unique_ptr<Geometry>

Returns a new instance of the given geometryTypeName.

Parameters
geometryTypeNameThe name of the geometry type
Returns
std::unique_ptr to new geometry instance
auto SFCGAL::tools::Registry::operator= ( const Registry &  ) -> Registry &=delete
delete