Leosac  0.8.0
Open Source Access Control
Leosac::Module::LedBuzzer::CRUDHandler< ObjectT, ObjectIdKey, SerializerT > Class Template Reference

CRUD handler for Buzzer and LED. More...

#include <CRUDHandler.hpp>

+ Inheritance diagram for Leosac::Module::LedBuzzer::CRUDHandler< ObjectT, ObjectIdKey, SerializerT >:
+ Collaboration diagram for Leosac::Module::LedBuzzer::CRUDHandler< ObjectT, ObjectIdKey, SerializerT >:

Public Member Functions

 CRUDHandler (const WebSockAPI::RequestContext &ctx)
 
std::vector< ActionActionParamrequired_permission (Verb verb, const WebSockAPI::json &req) const override
 
boost::optional< WebSockAPI::jsoncreate_impl (const WebSockAPI::json &req) override
 
boost::optional< WebSockAPI::jsonread_impl (const WebSockAPI::json &req) override
 
boost::optional< WebSockAPI::jsonupdate_impl (const WebSockAPI::json &req) override
 
boost::optional< WebSockAPI::jsondelete_impl (const WebSockAPI::json &req) override
 
- Public Member Functions inherited from Leosac::Module::WebSockAPI::ICRUDResourceHandler
boost::optional< jsonprocess (const ClientMessage &msg)
 

Static Public Member Functions

static WebSockAPI::CRUDResourceHandlerUPtr instanciate (WebSockAPI::RequestContext)
 
- Static Public Member Functions inherited from Leosac::Module::WebSockAPI::CRUDResourceHandler
static CRUDResourceHandlerUPtr instanciate (RequestContext)
 

Additional Inherited Members

- Public Types inherited from Leosac::Module::WebSockAPI::CRUDResourceHandler
using Factory = CRUDResourceHandlerUPtr(*)(RequestContext)
 
- Public Types inherited from Leosac::Module::WebSockAPI::ICRUDResourceHandler
enum  Verb { Verb::CREATE, Verb::READ, Verb::UPDATE, Verb::DELETE }
 
- Protected Types inherited from Leosac::Module::WebSockAPI::ICRUDResourceHandler
using ActionActionParam = std::pair< SecurityContext::Action, SecurityContext::ActionParam >
 A pair of Action and a generic ActionParam union. More...
 
- Protected Member Functions inherited from Leosac::Module::WebSockAPI::CRUDResourceHandler
 CRUDResourceHandler (RequestContext ctx)
 
virtual UserSecurityContextsecurity_context () const override
 Helper function that returns the security context. More...
 
- Protected Attributes inherited from Leosac::Module::WebSockAPI::CRUDResourceHandler
RequestContext ctx_
 

Detailed Description

template<typename ObjectT, const char * ObjectIdKey, typename SerializerT>
class Leosac::Module::LedBuzzer::CRUDHandler< ObjectT, ObjectIdKey, SerializerT >

CRUD handler for Buzzer and LED.

Since LED and Buzzer are very close wrt their attributes we use a templated CRUD Handler.

Template Parameters
ObjectTLED or Buzzer
ObjectIdKeyThe key in JSON to retrieve object's id.
SerializerTThe serializer type to use.

Definition at line 54 of file CRUDHandler.hpp.

Constructor & Destructor Documentation

◆ CRUDHandler()

template<typename ObjectT , const char * ObjectIdKey, typename SerializerT >
Leosac::Module::LedBuzzer::CRUDHandler< ObjectT, ObjectIdKey, SerializerT >::CRUDHandler ( const WebSockAPI::RequestContext ctx)
explicit

Definition at line 203 of file CRUDHandler.cpp.

Member Function Documentation

◆ create_impl()

template<typename ObjectT , const char * ObjectIdKey, typename SerializerT >
boost::optional< json > Leosac::Module::LedBuzzer::CRUDHandler< ObjectT, ObjectIdKey, SerializerT >::create_impl ( const WebSockAPI::json req)
overridevirtual

Implements Leosac::Module::WebSockAPI::ICRUDResourceHandler.

Definition at line 82 of file CRUDHandler.cpp.

◆ delete_impl()

template<typename ObjectT , const char * ObjectIdKey, typename SerializerT >
boost::optional< json > Leosac::Module::LedBuzzer::CRUDHandler< ObjectT, ObjectIdKey, SerializerT >::delete_impl ( const WebSockAPI::json req)
overridevirtual

Implements Leosac::Module::WebSockAPI::ICRUDResourceHandler.

Definition at line 189 of file CRUDHandler.cpp.

◆ instanciate()

template<typename ObjectT , const char * ObjectIdKey, typename SerializerT >
WebSockAPI::CRUDResourceHandlerUPtr Leosac::Module::LedBuzzer::CRUDHandler< ObjectT, ObjectIdKey, SerializerT >::instanciate ( WebSockAPI::RequestContext  ctx)
static

Definition at line 214 of file CRUDHandler.cpp.

◆ read_impl()

template<typename ObjectT , const char * ObjectIdKey, typename SerializerT >
boost::optional< json > Leosac::Module::LedBuzzer::CRUDHandler< ObjectT, ObjectIdKey, SerializerT >::read_impl ( const WebSockAPI::json req)
overridevirtual

Implements Leosac::Module::WebSockAPI::ICRUDResourceHandler.

Definition at line 131 of file CRUDHandler.cpp.

◆ required_permission()

template<typename ObjectT , const char * ObjectIdKey, typename SerializerT >
std::vector< WebSockAPI::ICRUDResourceHandler::ActionActionParam > Leosac::Module::LedBuzzer::CRUDHandler< ObjectT, ObjectIdKey, SerializerT >::required_permission ( Verb  verb,
const WebSockAPI::json req 
) const
overridevirtual

Implements Leosac::Module::WebSockAPI::ICRUDResourceHandler.

Definition at line 42 of file CRUDHandler.cpp.

◆ update_impl()

template<typename ObjectT , const char * ObjectIdKey, typename SerializerT >
boost::optional< json > Leosac::Module::LedBuzzer::CRUDHandler< ObjectT, ObjectIdKey, SerializerT >::update_impl ( const WebSockAPI::json req)
overridevirtual

Implements Leosac::Module::WebSockAPI::ICRUDResourceHandler.

Definition at line 170 of file CRUDHandler.cpp.


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