This singleton class holds a registry for capabilities supported by the current app. More...
#include <Capabilities.h>
Public Member Functions | |
virtual | ~Capabilities () |
void | add (const std::string &capability, CapabilityUtils::Type value, const std::string &doc) |
register a new capability More... | |
void | add (const std::string &capability, const char *value, const char *doc) |
std::string | dump () const |
create a JSON dump of the capabilities registry More... | |
CapabilityUtils::Result | check (const std::string &requested_capabilities) const |
check if the given required capabilities are fulfilled, returns a bool, a reason, and a verbose documentation More... | |
Capabilities (Capabilities const &)=delete | |
Don't allow creation through copy/move construction or assignment. More... | |
Capabilities & | operator= (Capabilities const &)=delete |
Capabilities (Capabilities &&)=delete | |
Capabilities & | operator= (Capabilities &&)=delete |
Static Public Member Functions | |
static Capabilities & | getCapabilityRegistry () |
Protected Attributes | |
std::map< std::string, std::pair< CapabilityUtils::Type, std::string > > | _capability_registry |
Capability registry. More... | |
Private Member Functions | |
Capabilities () | |
FRIEND_TEST (::CapabilitiesTest, boolTest) | |
FRIEND_TEST (::CapabilitiesTest, intTest) | |
FRIEND_TEST (::CapabilitiesTest, stringTest) | |
FRIEND_TEST (::CapabilitiesTest, versionTest) | |
FRIEND_TEST (::CapabilitiesTest, multipleTest) | |
FRIEND_TEST (::CapabilitiesTest, parseFail) | |
This singleton class holds a registry for capabilities supported by the current app.
A capability can refer to an optional library or optional functionality. Capabilities can either be registered as boolean values (present or not), an integer quantity (like the AD backing store size), a string (like the compiler used to build the executable), or a version number (numbers separated by dots, e.g. the petsc version).
Definition at line 35 of file Capabilities.h.
|
inlinevirtual |
Definition at line 38 of file Capabilities.h.
|
delete |
Don't allow creation through copy/move construction or assignment.
|
delete |
|
inlineprivate |
void Moose::Capabilities::add | ( | const std::string & | capability, |
CapabilityUtils::Type | value, | ||
const std::string & | doc | ||
) |
register a new capability
Definition at line 33 of file Capabilities.C.
Referenced by add(), MooseApp::addCapability(), and AppFactory::reg().
void Moose::Capabilities::add | ( | const std::string & | capability, |
const char * | value, | ||
const char * | doc | ||
) |
Definition at line 56 of file Capabilities.C.
CapabilityUtils::Result Moose::Capabilities::check | ( | const std::string & | requested_capabilities | ) | const |
check if the given required capabilities are fulfilled, returns a bool, a reason, and a verbose documentation
Definition at line 82 of file Capabilities.C.
Referenced by MooseApp::setupOptions().
std::string Moose::Capabilities::dump | ( | ) | const |
create a JSON dump of the capabilities registry
Definition at line 62 of file Capabilities.C.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |
Definition at line 22 of file Capabilities.C.
Referenced by MooseApp::addCapability(), AppFactory::reg(), and MooseApp::setupOptions().
|
delete |
|
delete |
|
protected |
Capability registry.
The capabilities registered here can be dumped using the –show-capabilities command line option. Capabilities are used by the test harness to conditionally enable/disable tests that rely on optional capabilities.
Definition at line 66 of file Capabilities.h.