A static registry used to register and build values of different types for the WebServerControl. More...
#include <WebServerControlTypeRegistry.h>
Classes | |
struct | Type |
class | TypeBase |
Base registry class for a type that is used to build values. More... | |
class | ValueBase |
The base class for a value that is produced by this registry. More... | |
Static Public Member Functions | |
static WebServerControlTypeRegistry & | getRegistry () |
template<typename DerivedValueType > | |
static char | add (const std::string &type_name) |
Registers a type with string name type_name and the given derived type. More... | |
static bool | isRegistered (const std::string &type) |
static std::unique_ptr< ValueBase > | build (const std::string &type, const std::string &name) |
Builds a value with the type type , name name , and a default value. More... | |
static std::unique_ptr< ValueBase > | build (const std::string &type, const std::string &name, const miniJson::Json &json_value) |
Builds a value with the type type , name name , and a value parsed from json_value . More... | |
Static Private Member Functions | |
static const TypeBase & | get (const std::string &type) |
Internal getter for the registration object for type type . More... | |
Private Attributes | |
std::map< std::string, std::unique_ptr< TypeBase > > | _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 32 of file WebServerControlTypeRegistry.h.
|
inlinestatic |
Registers a type with string name type_name
and the given derived type.
Definition at line 95 of file WebServerControlTypeRegistry.h.
Referenced by WebServerControl::registerRealEigenMatrix(), WebServerControl::registerScalarType(), and WebServerControl::registerVectorType().
|
inlinestatic |
Builds a value with the type type
, name name
, and a default value.
Definition at line 121 of file WebServerControlTypeRegistry.h.
Referenced by build(), WebServerControl::execute(), and WebServerControl::startServer().
|
inlinestatic |
Builds a value with the type type
, name name
, and a value parsed from json_value
.
Will throw ValueBase::Exception on a parsing error.
Definition at line 131 of file WebServerControlTypeRegistry.h.
|
inlinestaticprivate |
Internal getter for the registration object for type type
.
Definition at line 191 of file WebServerControlTypeRegistry.h.
|
static |
Definition at line 15 of file WebServerControlTypeRegistry.C.
Referenced by add(), get(), and isRegistered().
|
inlinestatic |
type
is registered. Definition at line 116 of file WebServerControlTypeRegistry.h.
Referenced by WebServerControl::startServer().
|
private |
The registration data.
Definition at line 201 of file WebServerControlTypeRegistry.h.
Referenced by add(), and isRegistered().
|
private |
The registered value types, to avoid registering the same underlying value type multiple times.
Definition at line 204 of file WebServerControlTypeRegistry.h.
Referenced by add().