Loading...
Searching...
No Matches
q3::Registry< Entry > Class Template Reference

An ordered set of interchangeable implementations of Entry, found by name. More...

#include <registry.hpp>

Public Member Functions

void add (std::unique_ptr< Entry > entry)
 Add entry; throws std::logic_error when one of its names is already registered.
 
std::string canonical_names (const std::string &separator) const
 
const std::vector< std::unique_ptr< Entry > > & entries () const
 Every entry, in registration order.
 
const Entry * find (const std::string &name) const
 The entry answering to name, or nullptr when none does.
 

Detailed Description

template<typename Entry>
class q3::Registry< Entry >

An ordered set of interchangeable implementations of Entry, found by name.

Definition at line 33 of file registry.hpp.

Member Function Documentation

◆ add()

template<typename Entry >
void q3::Registry< Entry >::add ( std::unique_ptr< Entry >  entry)
inline

Add entry; throws std::logic_error when one of its names is already registered.

Definition at line 36 of file registry.hpp.

References q3::Registry< Entry >::find().

Referenced by q3::input_format_registry(), q3::paw_one_center::one_center_convention_registry(), q3::pseudopotential_format_registry(), and q3::volumetric_field_writer_registry().

◆ canonical_names()

template<typename Entry >
std::string q3::Registry< Entry >::canonical_names ( const std::string &  separator) const
inline

Every entry's canonical name in registration order, joined by separator — the list a usage line or an "unknown name" error prints.

Definition at line 64 of file registry.hpp.

◆ entries()

template<typename Entry >
const std::vector< std::unique_ptr< Entry > > & q3::Registry< Entry >::entries ( ) const
inline

Every entry, in registration order.

Definition at line 56 of file registry.hpp.

◆ find()

template<typename Entry >
const Entry * q3::Registry< Entry >::find ( const std::string &  name) const
inline

The entry answering to name, or nullptr when none does.

Definition at line 45 of file registry.hpp.

Referenced by q3::Registry< Entry >::add().


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