template<class T>
eckit::Factory class

Public types

using product_t = T
using builder_t = typename product_t::builder_t
using key_t = std::string
using storage_t = std::map<key_t, builder_t*>

Public static functions

static auto instance() -> Factory<T>&
static auto build_type() -> std::string

Constructors, destructors, conversion operators

Factory(const Factory&) deleted
Factory(Factory&&) deleted

Public functions

void operator=(const Factory&) deleted
void operator=(Factory&&) deleted
auto exists(const key_t&) const -> bool
void regist(const key_t&, builder_t*)
void unregist(const key_t&)
auto get(const key_t&) const -> const builder_t&
auto size() const -> size_t
auto keys() const -> std::vector<key_t>

Friends

auto operator<<(std::ostream& os, const Factory<T>& o) -> std::ostream&

Function documentation

template<class T>
static Factory<T>& eckit::Factory<T>::instance()

Returns the instance of this singleton factory

template<class T>
static std::string eckit::Factory<T>::build_type()

Returns class name of the type built by this factory

template<class T>
bool eckit::Factory<T>::exists(const key_t&) const

Checks if a builder is registered

template<class T>
void eckit::Factory<T>::regist(const key_t&, builder_t*)

Exceptions
BadParameter if the builder already registered

Registers a builder

template<class T>
void eckit::Factory<T>::unregist(const key_t&)

Exceptions
BadParameter if the builder is not registered

Remove a registered builder

template<class T>
const builder_t& eckit::Factory<T>::get(const key_t&) const

Gets the builder registered to the associated key

template<class T>
size_t eckit::Factory<T>::size() const

Returns the number of builders registered to the factory

template<class T>
std::vector<key_t> eckit::Factory<T>::keys() const

Returns the builder keys registered to the factory