ampsci
High-precision calculations for one- and two-valence atomic systems
Module::Register

ok

Helper struct: constructing a Register adds a module to the Registry.

Used at file scope (inside an anonymous namespace) in every module .cpp file to self-register that module with the Registry. The constructor is the only thing of interest – it runs once, before main(), as part of static initialisation.

See the namespace-level documentation above for the usage pattern.

Note
The variable itself is never referenced by name. Pick any identifier you like (registrar, r_myModule, ...); the anonymous namespace gives it internal linkage so different files can reuse the same identifier without clashing.

#include <Modules.hpp>

Public Member Functions

 Register (const char *name, const char *description, ModuleFn fn)
 Register a module by constructing one of these at file scope.
 

Constructor & Destructor Documentation

◆ Register()

Module::Register::Register ( const char *  name,
const char *  description,
ModuleFn  fn 
)
inline

Register a module by constructing one of these at file scope.

Parameters
nameModule name as used in input files: Module::<name>{}.
descriptionOne-line description, shown by ./ampsci -m.
fnPointer to the module function.

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