SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
ColumnList_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 
8 
9 
10 namespace SWC { namespace Comm { namespace Protocol {
11 namespace Mngr { namespace Req {
12 
13 
14 
16  if(get_clients()->stopping()) {
18  } else if(!valid()) {
20  } else {
21  get_clients()->remove_mngr(endpoints);
22  endpoints.clear();
23  run();
24  }
25 }
26 
29  int err = ev->response_code();
30  switch(err) {
31  case Error::OK: {
32  try {
33  const uint8_t *ptr = ev->data.base + 4;
34  size_t remain = ev->data.size - 4;
35  rsp.decode(&ptr, &remain);
36 
37  } catch(...) {
40  err = e.code();
41  }
42  break;
43  }
46  if(!get_clients()->stopping() && valid()) {
48  request_again();
49  return;
50  }
51  break;
52  }
53  default:
54  break;
55  }
56  callback(err, rsp);
57 }
58 
59 
60 
61 }}}}}
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::LOG_INFO
@ LOG_INFO
Definition: Logger.h:35
SWC::Comm::Protocol::Mngr::Req::ColumnList_Base::get_clients
virtual SWC::client::Clients::Ptr & get_clients() noexcept=0
SWC::Comm::client::ConnQueueReqBase::request_again
void request_again()
Definition: ClientConnQueue.cc:12
SWC::Comm::Protocol::Mngr::Req::ColumnList_Base::endpoints
EndPoints endpoints
Definition: ColumnList_Base.h:49
SWC::Error::OK
@ OK
Definition: Error.h:45
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::Error::CLIENT_STOPPING
@ CLIENT_STOPPING
Definition: Error.h:127
SWC::Comm::Protocol::Mngr::Req::ColumnList_Base::run
bool run() override
Definition: ColumnList_Base.h:34
SWC::LOG_ERROR
@ LOG_ERROR
Definition: Logger.h:32
SWC::Comm::ConnHandlerPtr
std::shared_ptr< ConnHandler > ConnHandlerPtr
Definition: AppContext.h:17
ColumnList_Base.h
SWC::Comm::Protocol::Mngr::Req::ColumnList_Base::handle_no_conn
void handle_no_conn() override
Definition: ColumnList_Base.cc:15
SWC::Comm::Serializable::decode
void decode(const uint8_t **bufp, size_t *remainp)
Definition: Serializable.h:59
SWC::Comm::Protocol::Mngr::Req::ColumnList_Base::handle
void handle(ConnHandlerPtr conn, const Event::Ptr &ev) override
Definition: ColumnList_Base.cc:27
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::ColumnList_Base::callback
virtual void callback(int error, const Params::ColumnListRsp &rsp)=0
SWC::Error::Exception
Definition: Exception.h:21
SWC::Comm::Protocol::Mngr::Params::ColumnListRsp
Definition: ColumnList.h:46