SOIL C++
C++ Unified Device Interface
Object.h
Go to the documentation of this file.
1#pragma once
2#include "constants.h"
3#include "Element.h"
4
5namespace SOIL
6{
18 class DLL Object :
19 public Element
20 {
21 public:
34 Object(std::shared_ptr<Element> parent, std::string uuid, std::string name, std::string description, std::string ontology = "");
35
42 ~Object();
43
57 static std::shared_ptr<Object> create(std::shared_ptr<Element> parent, std::string uuid, std::string name, std::string description, std::string ontology = "");
58
65 web::json::value wjson(void);
66
73 virtual void read(void);
74
87 virtual HTTP::Json insert(HTTP::Json body);
88
95 virtual void remove(void);
96
108 HTTP::Response handle_get(HTTP::Request message, std::smatch match = std::smatch()) override;
109
124 HTTP::Response handle_put(HTTP::Request message, std::smatch match = std::smatch()) override;
125
141 HTTP::Response handle_delete(HTTP::Request message, std::smatch match = std::smatch()) override;
142
149 inline std::shared_ptr<Object> ptr(void)
150 {
151 return std::dynamic_pointer_cast<Object>(Element::self);
152 }
153 };
154}
155
SOIL Base Element.
Definition: Element.h:24
std::shared_ptr< Element > self
Self Pointer.
Definition: Element.h:46
Object Class.
Definition: Object.h:20
std::shared_ptr< Object > ptr(void)
Get Pointer.
Definition: Object.h:149
web::json::value Json
HTTP JSON.
Definition: Types.h:39
web::http::http_request Request
HTTP Request.
Definition: Types.h:11
web::http::http_response Response
HTTP Response.
Definition: Types.h:18
Type definitions.
Definition: Container.h:7