SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
SWC::Broker::AppContext Class Referencefinal

#include <swcdb/broker/AppContext.h>

+ Inheritance diagram for SWC::Broker::AppContext:
+ Collaboration diagram for SWC::Broker::AppContext:

Classes

struct  CommandHandler
 

Public Types

typedef std::shared_ptr< AppContextPtr
 
- Public Types inherited from SWC::Comm::AppContext
typedef std::shared_ptr< AppContextPtr
 

Public Member Functions

 AppContext ()
 
void init (const std::string &host, const Comm::EndPoints &endpoints) override
 
void set_srv (Comm::server::SerializedServer::Ptr srv)
 
virtual ~AppContext () noexcept
 
void handle_established (Comm::ConnHandlerPtr conn) override
 
void handle_disconnect (Comm::ConnHandlerPtr conn) noexcept override
 
void handle (Comm::ConnHandlerPtr conn, const Comm::Event::Ptr &ev) override
 
void net_bytes_sent (const Comm::ConnHandlerPtr &conn, size_t b) noexcept override
 
void net_bytes_received (const Comm::ConnHandlerPtr &conn, size_t b) noexcept override
 
void net_accepted (const Comm::EndPoint &endpoint, bool secure) noexcept override
 
void shutting_down (const std::error_code &ec, const int &sig)
 
void stop () override
 
- Public Member Functions inherited from SWC::Comm::AppContext
SWC_CAN_INLINE AppContext (Config::Property::Value_enum_g::Ptr a_cfg_encoder) noexcept
 
 AppContext (AppContext &&)=delete
 
 AppContext (const AppContext &)=delete
 
AppContextoperator= (AppContext &&)=delete
 
AppContextoperator= (const AppContext &)=delete
 

Static Public Member Functions

static Ptr make ()
 

Private Attributes

Comm::server::SerializedServer::Ptr m_srv = nullptr
 
Metric::Reporting::Ptr m_metrics = nullptr
 

Additional Inherited Members

- Public Attributes inherited from SWC::Comm::AppContext
const Config::Property::Value_enum_g::Ptr cfg_encoder
 

Detailed Description

Definition at line 31 of file AppContext.h.

Member Typedef Documentation

◆ Ptr

typedef std::shared_ptr<AppContext> SWC::Broker::AppContext::Ptr

Definition at line 70 of file AppContext.h.

Constructor & Destructor Documentation

◆ AppContext()

SWC::Broker::AppContext::AppContext ( )
inline

Definition at line 109 of file AppContext.h.

Referenced by make().

+ Here is the caller graph for this function:

◆ ~AppContext()

virtual SWC::Broker::AppContext::~AppContext ( )
inlinevirtualnoexcept

Reimplemented from SWC::Comm::AppContext.

Definition at line 135 of file AppContext.h.

Member Function Documentation

◆ handle()

void SWC::Broker::AppContext::handle ( Comm::ConnHandlerPtr  conn,
const Comm::Event::Ptr ev 
)
inlineoverridevirtual

Implements SWC::Comm::AppContext.

Definition at line 149 of file AppContext.h.

References SWC::Env::Bkr::can_process(), m_metrics, SWC::Comm::Protocol::Bkr::MAX_CMD, SWC::Comm::Protocol::Common::Handler::not_implemented(), SWC::Env::Bkr::post(), and SWC::Env::Bkr::processed().

+ Here is the call graph for this function:

◆ handle_disconnect()

void SWC::Broker::AppContext::handle_disconnect ( Comm::ConnHandlerPtr  conn)
inlineoverridevirtualnoexcept

Implements SWC::Comm::AppContext.

Definition at line 143 of file AppContext.h.

References m_metrics, and m_srv.

◆ handle_established()

void SWC::Broker::AppContext::handle_established ( Comm::ConnHandlerPtr  conn)
inlineoverridevirtual

Implements SWC::Comm::AppContext.

Definition at line 137 of file AppContext.h.

References m_metrics, and m_srv.

◆ init()

void SWC::Broker::AppContext::init ( const std::string &  host,
const Comm::EndPoints endpoints 
)
inlineoverridevirtual

Reimplemented from SWC::Comm::AppContext.

Definition at line 116 of file AppContext.h.

References SWC::Env::Bkr::io(), m_metrics, shutting_down(), and SWC::Env::Bkr::start().

+ Here is the call graph for this function:

◆ make()

static Ptr SWC::Broker::AppContext::make ( )
inlinestatic

Definition at line 72 of file AppContext.h.

References AppContext(), SWC::Env::Bkr::init(), SWC::Env::Clients::init(), SWC::Env::Bkr::io(), SWC::client::Clients::make(), SWC::Comm::IoContext::make(), and SWC::Env::Config::settings().

Referenced by SWC::Broker::make_service().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ net_accepted()

void SWC::Broker::AppContext::net_accepted ( const Comm::EndPoint endpoint,
bool  secure 
)
inlineoverridevirtualnoexcept

Reimplemented from SWC::Comm::AppContext.

Definition at line 185 of file AppContext.h.

References m_metrics.

◆ net_bytes_received()

void SWC::Broker::AppContext::net_bytes_received ( const Comm::ConnHandlerPtr conn,
size_t  b 
)
inlineoverridevirtualnoexcept

Reimplemented from SWC::Comm::AppContext.

Definition at line 179 of file AppContext.h.

References m_metrics.

◆ net_bytes_sent()

void SWC::Broker::AppContext::net_bytes_sent ( const Comm::ConnHandlerPtr conn,
size_t  b 
)
inlineoverridevirtualnoexcept

Reimplemented from SWC::Comm::AppContext.

Definition at line 173 of file AppContext.h.

References m_metrics.

◆ set_srv()

void SWC::Broker::AppContext::set_srv ( Comm::server::SerializedServer::Ptr  srv)
inline

Definition at line 131 of file AppContext.h.

References m_srv.

◆ shutting_down()

void SWC::Broker::AppContext::shutting_down ( const std::error_code &  ec,
const int &  sig 
)
inline

Definition at line 191 of file AppContext.h.

References SWC::Env::Bkr::io(), SWC::LOG_INFO, m_srv, shutting_down(), SWC_CAN_INLINE, SWC_LOG, SWC_LOGF, and SWC_QUICK_EXIT.

Referenced by init(), and shutting_down().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stop()

void SWC::Broker::AppContext::stop ( )
inlineoverridevirtual

Reimplemented from SWC::Comm::AppContext.

Definition at line 224 of file AppContext.h.

References SWC::Env::Clients::get(), SWC::Env::Bkr::io(), m_metrics, m_srv, SWC::Env::Bkr::reset(), SWC::Env::Clients::reset(), and SWC::Env::Bkr::shuttingdown().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_metrics

Metric::Reporting::Ptr SWC::Broker::AppContext::m_metrics = nullptr
private

◆ m_srv

Comm::server::SerializedServer::Ptr SWC::Broker::AppContext::m_srv = nullptr
private

Definition at line 253 of file AppContext.h.

Referenced by handle_disconnect(), handle_established(), set_srv(), shutting_down(), and stop().


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