C++ Unified Device Interface
SOIL::Common Class Reference

#include <Common.h>

Inheritance diagram for SOIL::Common:
HTTP::Resource SOIL::Figure< T, -1, -1 > SOIL::Figure< T, x, y > SOIL::Function SOIL::Object SOIL::Parameter< T, x, y > SOIL::Variable< T, x, y >

Public Member Functions

 Common (std::shared_ptr< Common > parent, std::string uuid, std::string name, std::string description, std::string ontology="")
 
virtual ~Common ()
 
std::vector< std::string > fqid (void)
 
std::shared_ptr< Commonoperator[] (std::string fqid)
 
bool insert (std::string uuid, std::shared_ptr< Common > &child)
 
bool insert (std::string uuid, Common *child)
 
bool remove (std::string uuid)
 
template<typename T >
T * cast (void)
 
bool is_object (void) const
 
bool is_variable (void) const
 
bool is_function (void) const
 
bool is_parameter (void) const
 
virtual HTTP::Json wjson (void)
 
virtual std::string json (void)
 
HTTP::Response handle (HTTP::Request request, std::wsmatch match=std::wsmatch())
 HTTP Handler. More...
 
- Public Member Functions inherited from HTTP::Resource
 Resource ()
 Constructor. More...
 
 ~Resource ()
 Default Destructor. More...
 
virtual Response handle (Request message, std::wsmatch match=std::wsmatch())
 HTTP Handler. More...
 
virtual Response handle_get (Request message, std::wsmatch match=std::wsmatch())
 HTTP GET Handler. More...
 
virtual Response handle_put (Request message, std::wsmatch match=std::wsmatch())
 HTTP PUT Handler. More...
 
virtual Response handle_post (Request message, std::wsmatch match=std::wsmatch())
 HTTP POST Handler. More...
 
virtual Response handle_delete (Request message, std::wsmatch match=std::wsmatch())
 HTTP DELETE Handler. More...
 
virtual Response handle_patch (Request message, std::wsmatch match=std::wsmatch())
 HTTP PATCH Handler. More...
 
virtual Response handle_options (Request message, std::wsmatch match=std::wsmatch())
 HTTP OPTIONS Handler. More...
 
virtual Response handle_head (Request message, std::wsmatch match=std::wsmatch())
 HTTP HEAD Handler. More...
 
virtual Response handle_exception (Request message, std::exception &exception, std::wsmatch match=std::wsmatch())
 HTTP Exception handler. More...
 

Public Attributes

std::map< std::string, std::shared_ptr< Common > > children
 
std::shared_ptr< Commonparent
 
std::shared_ptr< Commonself
 
std::string uuid
 
std::string name
 
std::string description
 
std::string ontology
 
std::recursive_mutex mutex
 

Additional Inherited Members

- Static Public Member Functions inherited from HTTP::Resource
static web::json::value request_info (Request message, std::wsmatch match=std::wsmatch())
 Request Info. More...
 
- Protected Member Functions inherited from HTTP::Resource
void apply_headers (Response &response)
 Apply headers. More...
 
- Protected Attributes inherited from HTTP::Resource
std::vector< web::http::method > allowed_methods
 Allowed methods. More...
 
std::wstring content_type
 Content type. More...
 
std::wstring allowed_origins
 Allowed Origins. More...
 

Detailed Description

Definition at line 14 of file Common.h.

Constructor & Destructor Documentation

◆ Common()

SOIL::Common::Common ( std::shared_ptr< Common parent,
std::string  uuid,
std::string  name,
std::string  description,
std::string  ontology = "" 
)

Definition at line 5 of file Common.cpp.

◆ ~Common()

SOIL::Common::~Common ( )
virtual

Definition at line 19 of file Common.cpp.

Member Function Documentation

◆ cast()

template<typename T >
T * SOIL::Common::cast ( void  )

Definition at line 49 of file Common.h.

◆ fqid()

std::vector< std::string > SOIL::Common::fqid ( void  )

Definition at line 26 of file Common.cpp.

◆ handle()

HTTP::Response SOIL::Common::handle ( HTTP::Request  message,
std::wsmatch  match = std::wsmatch() 
)
virtual

Handler that is called by the server on HTTP requests. By default, this function redirects to the more specifc ones based on the respective HTTP Verb. In case an exception occurs, it calls the exception handler.

Parameters
[in]messageIncoming HTTP request as preprocessed by cpprestsdk
[in]matchMatch result of the request path that led to this resource
Returns
Outgoing HTTP response to be processed by cpprestdsk

Reimplemented from HTTP::Resource.

Definition at line 143 of file Common.cpp.

◆ insert() [1/2]

bool SOIL::Common::insert ( std::string  uuid,
Common child 
)

Definition at line 86 of file Common.cpp.

◆ insert() [2/2]

bool SOIL::Common::insert ( std::string  uuid,
std::shared_ptr< Common > &  child 
)

Definition at line 79 of file Common.cpp.

◆ is_function()

bool SOIL::Common::is_function ( void  ) const

Definition at line 108 of file Common.cpp.

◆ is_object()

bool SOIL::Common::is_object ( void  ) const

Definition at line 98 of file Common.cpp.

◆ is_parameter()

bool SOIL::Common::is_parameter ( void  ) const

Definition at line 113 of file Common.cpp.

◆ is_variable()

bool SOIL::Common::is_variable ( void  ) const

Definition at line 103 of file Common.cpp.

◆ json()

std::string SOIL::Common::json ( void  )
virtual

Definition at line 136 of file Common.cpp.

◆ operator[]()

std::shared_ptr< SOIL::Common > SOIL::Common::operator[] ( std::string  fqid)

Definition at line 38 of file Common.cpp.

◆ remove()

bool SOIL::Common::remove ( std::string  uuid)

Definition at line 91 of file Common.cpp.

◆ wjson()

HTTP::Json SOIL::Common::wjson ( void  )
virtual

Member Data Documentation

◆ children

std::map<std::string, std::shared_ptr<Common> > SOIL::Common::children

Definition at line 18 of file Common.h.

◆ description

std::string SOIL::Common::description

Definition at line 23 of file Common.h.

◆ mutex

std::recursive_mutex SOIL::Common::mutex

Definition at line 26 of file Common.h.

◆ name

std::string SOIL::Common::name

Definition at line 22 of file Common.h.

◆ ontology

std::string SOIL::Common::ontology

Definition at line 24 of file Common.h.

◆ parent

std::shared_ptr<Common> SOIL::Common::parent

Definition at line 19 of file Common.h.

◆ self

std::shared_ptr<Common> SOIL::Common::self

Definition at line 20 of file Common.h.

◆ uuid

std::string SOIL::Common::uuid

Definition at line 21 of file Common.h.


The documentation for this class was generated from the following files: