SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
ColumnGet_Base.cc
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 
9 
10 
11 namespace SWC { namespace Comm { namespace Protocol {
12 namespace Mngr { namespace Req {
13 
14 
15 
17  if(get_clients()->stopping()) {
19  } else if(!valid()) {
21  } else {
22  get_clients()->remove_mngr(endpoints);
23  endpoints.clear();
24  run();
25  }
26 }
27 
30  int err = ev->response_code();
31  switch(err) {
32  case Error::OK: {
33  try {
34  const uint8_t *ptr = ev->data.base + 4;
35  size_t remain = ev->data.size - 4;
36  rsp.decode(&ptr, &remain);
37 
38  } catch(...) {
41  err = e.code();
42  }
43  break;
44  }
47  if(!get_clients()->stopping() && valid()) {
49  request_again();
50  return;
51  }
52  break;
53  }
54  default:
55  break;
56  }
57  callback(err, rsp);
58 }
59 
60 
61 
62 }}}}}
SWC::Error::Exception::code
constexpr SWC_CAN_INLINE int code() const noexcept
Definition: Exception.h:51
SWC_LOG_OSTREAM
#define SWC_LOG_OSTREAM
Definition: Logger.h:44
SWC::Error::REQUEST_TIMEOUT
@ REQUEST_TIMEOUT
Definition: Error.h:73
SWC::Core::Vector::clear
SWC_CAN_INLINE void clear() noexcept(_NoExceptDestructor)
Definition: Vector.h:120
SWC_LOG_OUT
#define SWC_LOG_OUT(pr, _code_)
Definition: Logger.h:178
SWC::Comm::Protocol::Mngr::Req::ColumnGet_Base::handle
void handle(ConnHandlerPtr conn, const Event::Ptr &ev) override
Definition: ColumnGet_Base.cc:28
SWC::LOG_INFO
@ LOG_INFO
Definition: Logger.h:35
SWC::Comm::client::ConnQueueReqBase::request_again
void request_again()
Definition: ClientConnQueue.cc:12
SWC::Comm::Protocol::Mngr::Req::ColumnGet_Base::get_clients
virtual SWC::client::Clients::Ptr & get_clients() noexcept=0
SWC::Comm::Protocol::Mngr::Req::ColumnGet_Base::endpoints
EndPoints endpoints
Definition: ColumnGet_Base.h:50
SWC::Error::OK
@ OK
Definition: Error.h:45
ColumnGet_Base.h
SWC::Comm::DispatchHandler::valid
virtual bool valid()
Definition: DispatchHandler.h:28
SWC_CURRENT_EXCEPTION
#define SWC_CURRENT_EXCEPTION(_msg_)
Definition: Exception.h:119
SWC
The SWC-DB C++ namespace 'SWC'.
Definition: main.cc:12
SWC::Error::MNGR_NOT_INITIALIZED
@ MNGR_NOT_INITIALIZED
Definition: Error.h:88
SWC::Comm::Protocol::Mngr::Req::ColumnGet_Base::callback
virtual void callback(int error, const Params::ColumnGetRsp &rsp)=0
SWC::Error::CLIENT_STOPPING
@ CLIENT_STOPPING
Definition: Error.h:127
Commands.h
SWC::LOG_ERROR
@ LOG_ERROR
Definition: Logger.h:32
SWC::Comm::ConnHandlerPtr
std::shared_ptr< ConnHandler > ConnHandlerPtr
Definition: AppContext.h:17
SWC::Comm::Protocol::Mngr::Params::ColumnGetRsp
Definition: ColumnGet.h:59
SWC::Comm::Serializable::decode
void decode(const uint8_t **bufp, size_t *remainp)
Definition: Serializable.h:59
SWC::Comm::Protocol::Mngr::Req::ColumnGet_Base::handle_no_conn
void handle_no_conn() override
Definition: ColumnGet_Base.cc:16
SWC::Comm::Event::Ptr
std::shared_ptr< Event > Ptr
Definition: Event.h:33
SWC::Error::print
void print(std::ostream &out, int err)
Definition: Error.cc:191
SWC::Error::CANCELLED
@ CANCELLED
Definition: Error.h:56
SWC::Comm::Protocol::Mngr::Req::ColumnGet_Base::run
bool run() override
Definition: ColumnGet_Base.h:34
SWC::Error::Exception
Definition: Exception.h:21