32 std::map<std::string, std::shared_ptr<Element>> arguments;
41 std::map<std::string, std::shared_ptr<Element>> returns;
94 template<
typename T,
int x = -1,
int y = -1>
112 template<
typename T,
int x = -1,
int y =-1>
130 template<
typename T,
int x = -1,
int y = -1>
147 template<
typename T,
int x = -1,
int y = -1>
163 template<
typename T,
int x = -1,
int y = -1>
215 DLL
virtual std::map<std::string, HTTP::Json>
invoke(std::map<std::string, HTTP::Json> arguments);
223 DLL
inline std::shared_ptr<Function>
ptr(
void)
228 template<
typename T,
int x,
int y>
233 template<
typename T,
int x,
int y>
236 Parameter<T, x, y>* par =
new Parameter<T, x, y>(
Element::self,
uuid,
name,
description, unit,
false,
ontology, range);
237 arguments[
uuid].reset(par);
238 *par = default_value;
242 template<
typename T,
int x,
int y>
247 template<
typename T,
int x,
int y>
251 json_root[U(
"uuid")] = to_json<std::string>(
uuid);
252 json_root[U(
"value")] = value.json()[U(
"value")];
255 template<
typename T,
int x,
int y>
258 for (
auto& a : external_json.as_array())
260 if (to_value<std::string>(a[U(
"uuid")]) ==
uuid)
std::string uuid
Local UUID.
std::string description
Description.
std::string ontology
Ontology identifier.
std::shared_ptr< Element > parent
Parent Pointer.
std::shared_ptr< Element > self
Self Pointer.
DLL std::shared_ptr< Function > ptr(void)
Get Pointer.
HTTP::Json make_return(std::string uuid, Container< T, x, y > value)
Make JSON Return.
static std::shared_ptr< Function > create(std::shared_ptr< Element > parent, std::string uuid, std::string name, std::string description, std::string ontology="")
Create new Function.
Container< T, x, y > make_argument(std::string uuid, HTTP::Json external_json)
Make Argument from JSON.
virtual DLL HTTP::Response handle_post(HTTP::Request request, std::smatch match=std::smatch())
Handle HTTP POST request.
virtual DLL HTTP::Response handle_get(HTTP::Request request, std::smatch match=std::smatch())
Handle HTTP GET request.
void add_argument(std::string uuid, std::string name, std::string description, std::string unit, SOIL::Range< T > range=SOIL::Range< T >(), std::string ontology="")
Add argument.
DLL ~Function()
Destructor.
void add_return(std::string uuid, std::string name, std::string description, std::string unit, SOIL::Range< T > range=SOIL::Range< T >(), std::string ontology="")
Add return value.
virtual DLL std::map< std::string, HTTP::Json > invoke(std::map< std::string, HTTP::Json > arguments)
Core Invocation.
DLL Function(std::shared_ptr< Element > parent, std::string uuid, std::string name, std::string description, std::string ontology="")
Constructor.
DLL HTTP::Json wjson(void)
HTTP JSON.
web::json::value Json
HTTP JSON.
web::http::http_request Request
HTTP Request.
web::http::http_response Response
HTTP Response.