SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
AppHandler.h
Go to the documentation of this file.
1 /*
2  * SWC-DB© Copyright since 2019 Alex Kashirin <kashirin.alex@gmail.com>
3  * License details at <https://github.com/kashirin-alex/swc-db/#license>
4  */
5 
6 
7 #ifndef swcdb_core_comm_AppHandler_h
8 #define swcdb_core_comm_AppHandler_h
9 
10 #include "swcdb/core/comm/Event.h"
12 
13 namespace SWC { namespace Comm {
14 
15 typedef void (*AppHandler_t)(const ConnHandlerPtr& conn,
16  const Event::Ptr& ev);
17 
18 class AppHandler {
19  public:
20 
22  AppHandler(const ConnHandlerPtr& conn, const Event::Ptr& ev) noexcept
23  : m_conn(conn), m_ev(ev) {
24  }
25 
26  virtual void run() = 0;
27 
28  protected:
29 
30  virtual ~AppHandler() noexcept { }
31 
34 };
35 
36 
37 }} // namespace SWC::Comm
38 
39 
40 
41 #endif // swcdb_core_comm_AppHandler_h
SWC::Comm::AppHandler::run
virtual void run()=0
SWC::Comm::AppHandler::AppHandler
SWC_CAN_INLINE AppHandler(const ConnHandlerPtr &conn, const Event::Ptr &ev) noexcept
Definition: AppHandler.h:22
SWC::Comm::AppHandler
Definition: AppHandler.h:18
ConnHandler.h
SWC::Comm::AppHandler::m_conn
ConnHandlerPtr m_conn
Definition: AppHandler.h:32
SWC::Comm::AppHandler::m_ev
Event::Ptr m_ev
Definition: AppHandler.h:33
SWC_CAN_INLINE
#define SWC_CAN_INLINE
Definition: Compat.h:102
SWC
The SWC-DB C++ namespace 'SWC'.
Definition: main.cc:12
Event.h
SWC::Comm::AppHandler::~AppHandler
virtual ~AppHandler() noexcept
Definition: AppHandler.h:30
SWC::Comm::ConnHandlerPtr
std::shared_ptr< ConnHandler > ConnHandlerPtr
Definition: AppContext.h:17
SWC::Comm::AppHandler_t
void(* AppHandler_t)(const ConnHandlerPtr &conn, const Event::Ptr &ev)
Definition: AppHandler.h:15
SWC::Comm::Event::Ptr
std::shared_ptr< Event > Ptr
Definition: Event.h:33