rngtest::Battery class

Battery.

This class uses runtime polymorphism without client-side inheritance: inheritance is confined to the internals of the this class, invisible to client-code. The class exclusively deals with ownership enabling client-side value semantics. Credit goes to Sean Parent at Adobe: https://github.com/sean-parent/sean-parent.github.com/wiki/ Papers-and-Presentations. For example client code that models a Battery, see rngtest::TestU01Suite.

Constructors, destructors, conversion operators

template<typename T, typename... CtrArgs>
Battery(std::function<T()> c][[maybe_unused], CtrArgs... args) explicit
Constructor taking a function pointer to a constructor of an object modeling Concept.
Battery(const Battery& x)
Copy constructor.
Battery(Battery&&) noexcept defaulted
Move constructor.

Public functions

void evaluate(std::vector<std::vector<std::string>> status) const
Public interface to evaluating a statistical test.
void npval(std::size_t n) const
Public interface to collecting the number of statistics from a test.
void names(std::vector<std::string> n) const
Public interface to collecting test name(s) from a test.
auto operator=(const Battery& x) -> Battery&
Copy assignment.
auto operator=(Battery&&) noexcept -> Battery& defaulted
Move assignment.

Function documentation

template<typename T, typename... CtrArgs>
rngtest::Battery::Battery(std::function<T()> c][[maybe_unused], CtrArgs... args) explicit

Constructor taking a function pointer to a constructor of an object modeling Concept.

Parameters
args in Constructor arguments

Passing std::function allows late execution of the constructor of T, i.e., at some future time, and thus usage from a factory. Note that the value of the first function argument, std::function<T()>, is not used here, but its constructor type, T, is used to enable the compiler to deduce the model constructor type, used to create its Charm proxy, defined by T::Proxy. The actual constructor of T is not called here but at some future time by the Charm++ runtime system, here only an asynchrounous ckNew() is called, i.e., a message (or request) for a future call to T's constructor. This overload is only enabled for Charm++ chare objects defining typedef 'Proxy', which must define the Charm++ proxy. All optional constructor arguments are forwarded to ckNew() and thus to T's constructor. If it was somehow possible to obtain all bound arguments' types and values from an already-bound std::function, we could use those instead of having to explicitly forward the model constructor arguments via this host constructor.