A static registry used to register and build values of different types for the WebServerControl. More...
#include <WebServerControlTypeRegistry.h>
Classes | |
| class | ControlledValueBase |
| The base class for a value that is produced by this registry. More... | |
| struct | RegisteredType |
| Derived registry item. More... | |
| class | RegisteredTypeBase |
| Base registry class for a type that is used to build values. More... | |
Static Public Member Functions | |
| static WebServerControlTypeRegistry & | getRegistry () |
| template<class ControlledValue , class ValueType > | |
| static char | add (const std::string &type_name, std::function< ValueType(const nlohmann::json &)> &&parse_function) |
| Register a type in the registry. More... | |
| static const RegisteredTypeBase * | query (const std::string &type) |
| Query the registration for the given type. More... | |
| static const RegisteredTypeBase & | get (const std::string &type) |
| Get the registration for the given type, erroring if it isn't registered. More... | |
Private Attributes | |
| std::map< std::string, std::unique_ptr< RegisteredTypeBase > > | _name_map |
| The registration data. More... | |
| std::set< std::type_index > | _value_types |
| The registered value types, to avoid registering the same underlying value type multiple times. More... | |
A static registry used to register and build values of different types for the WebServerControl.
Needed due to the complexities of parsing parameter types from generic JSON received by the web server.
Definition at line 33 of file WebServerControlTypeRegistry.h.
|
static |
Register a type in the registry.
| ControlledValue | The derived ControlledValueBase class that contains the implementation for setting the controllable value |
| ValueType | The underlying type of the value to be controlled |
| type_name | Human readable name for the type of the value to be controlled |
| parse_function | Function used to parse the value from JSON |
Definition at line 185 of file WebServerControlTypeRegistry.h.
Referenced by Moose::WebServerControlTypeRegistration::registerType().
|
static |
Get the registration for the given type, erroring if it isn't registered.
Definition at line 36 of file WebServerControlTypeRegistry.C.
Referenced by WebServerControl::execute().
|
static |
Definition at line 15 of file WebServerControlTypeRegistry.C.
|
static |
Query the registration for the given type.
Definition at line 24 of file WebServerControlTypeRegistry.C.
Referenced by WebServerControl::addServerActionsInternal(), and get().
|
private |
The registration data.
Definition at line 177 of file WebServerControlTypeRegistry.h.
|
private |
The registered value types, to avoid registering the same underlying value type multiple times.
Definition at line 180 of file WebServerControlTypeRegistry.h.
Referenced by add().
1.8.14