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 > > | _types |
The registration data. 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 30 of file WebServerControlTypeRegistry.h.
|
inlinestatic |
Registers a type with string name type_name
and the given derived type.
Definition at line 93 of file WebServerControlTypeRegistry.h.
Referenced by WebServerControl::registerScalarType(), and WebServerControl::registerVectorType().
|
inlinestatic |
Builds a value with the type type
, name name
, and a default value.
Definition at line 108 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 118 of file WebServerControlTypeRegistry.h.
|
inlinestaticprivate |
Internal getter for the registration object for type type
.
Definition at line 176 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 103 of file WebServerControlTypeRegistry.h.
Referenced by WebServerControl::startServer().
|
private |
The registration data.
Definition at line 186 of file WebServerControlTypeRegistry.h.
Referenced by add(), and isRegistered().