rngtest::ctr::CmdLine class

CmdLine is a TaggedTuple specialized to RNGTest.

Base classes

template<class List>
class tk::TaggedTuple
Tagged tuple, allowing tag-based access.

Public types

using keywords = tk::cmd_keywords<kw::verbose, kw::charestate, kw::control, kw::help, kw::helpctr, kw::helpkw, kw::screen, kw::quiescence, kw::trace, kw::version, kw::license>
using ignore = brigand::set<tag::cmdinfo, tag::ctrinfo, tag::helpkw>
Set of tags to ignore when printing this CmdLine.

Constructors, destructors, conversion operators

CmdLine(tk::ctr::HelpFactory ctrinfo = tk::ctr::HelpFactory())
Constructor: set all defaults.

Pack/Unpack: Serialize CmdLine object for Charm++

void pup(PUP::er& p)
Pack/Unpack serialize member function.
auto logname(const std::string& def, int nrestart) const -> std::string
void operator|(PUP::er& p, CmdLine& c)
Pack/Unpack serialize operator|.

Typedef documentation

using rngtest::ctr::CmdLine::keywords = tk::cmd_keywords<kw::verbose, kw::charestate, kw::control, kw::help, kw::helpctr, kw::helpkw, kw::screen, kw::quiescence, kw::trace, kw::version, kw::license>

RNGTest command-line keywords

Function documentation

rngtest::ctr::CmdLine::CmdLine(tk::ctr::HelpFactory ctrinfo = tk::ctr::HelpFactory())

Constructor: set all defaults.

Parameters
ctrinfo in std::map of control file keywords and their info

Anything not set here is initialized by the compiler using the default constructor for the corresponding type. The ctrinfo map argument is optional. If not given, it is an empty std::map constructed in-place and affects nothing. If given, it contains the control file keywords, all of which are moved into the relevant slot (tag::ctrinfo). This allows constructing, e.g., a CmdLine object both with and without this information in place, which are both used at different stages of the execution. For example, because the command-line is parsed very early on during runtime while the input deck is only parsed much later, the control-file keywords and their information (owned by and generated by the input deck and its constructor) is not yet available when the CmdLine object is constructed. However, during command-line parsing it is still possible to request information on a control file keyword, so it must be available. The input deck is where all parsed information goes during control file parsing and is stored at global scope, see, e.g., walker::g_inputdeck. This global-scope (still namespace-scope), input deck object is thus created before command-line parsing. The input deck object's constructor (working only on type information, available at compile-time, of all the control file keywords) creates a run-time map. This is a run-time map, but available before main() starts, because it is const and it is initialized as a global-scope map. This map is then passed in here as ctrinfo, and its contents inserted into the CmdLine object, making the control-file keywords and their info available during command-line parsing. Since the input deck stack contains a copy of the command-line stack, the command-line stack must be possible to be instantiated without passing the ctrinfo map, otherwise it would be a mutual dependency.

void rngtest::ctr::CmdLine::pup(PUP::er& p)

Pack/Unpack serialize member function.

Parameters
in/out Charm++'s PUP::er serializer object reference

std::string rngtest::ctr::CmdLine::logname(const std::string& def, int nrestart) const

Parameters
def in Default log file name (so we don't mess with user's)
nrestart in Number of times restarted
Returns Log file name

Compute and return log file name

void rngtest::ctr::CmdLine::operator|(PUP::er& p, CmdLine& c)

Pack/Unpack serialize operator|.

Parameters
in/out Charm++'s PUP::er serializer object reference
in/out CmdLine object reference