Template Class Module

Class Documentation

template<typename I>
class Module

Public Types

using Fn = std::unique_ptr<I> (*)()
using Map = std::map<std::string, Fn>

Public Functions

std::string moduleName()
HelpMap &getHelpRecursive(HelpMap &map, bool getAll)
std::string moduleName()
HelpMap &getHelpRecursive(HelpMap &map, bool getAll)
std::string moduleName()

Public Static Functions

static inline void setExternalImplementation(Fn generator)

Sets the function to generate new instances of an implementation not included in the relevant module.cfg file.

Parameters:

generator – A pointer to a function that returns a std::unique_ptr to an instance of the template class.

static inline void setImplementation(const std::string &implName)

Sets the implementation of this module to one of the named implementations in the module.cfg file.

Parameters:

implName – A string containing a name matching one of the implementations defined in module.cfg.

static inline std::unique_ptr<I> getInstance()

Returns a std::unique_ptr to a new instance of the current implementation.

static inline std::unique_ptr<I> &getUniqueInstance(bool suppressInit = false)

Returns a std::unique_ptr to the static instance of the current implementation.

static inline I &getImplementation()

Returns a reference to the static instance of the current implementation.

static inline std::list<std::string> listImplementations()

Returns a list of all the implementations named in the relevant module.cfg file.

static inline std::string implementation()

Returns the name of the current implementation , if it is listed in the relevant module.cfg file. Otherwise returns an empty string.

static std::string moduleName()

Returns a string containing the name of the module.

static HelpMap &getHelpRecursive(HelpMap &helpMap, bool getAll)

Adds help information to the argument help map, according to the boolean getAll argument.

Implementation dependent.

static inline void finalize()

Finalizes the Module by setting both pointers to nullptr.