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::Comm::Event Class Referencefinal

#include <swcdb/core/comm/Event.h>

+ Collaboration diagram for SWC::Comm::Event:

Public Types

typedef std::shared_ptr< EventPtr
 

Public Member Functions

 ~Event () noexcept
 
SWC_CAN_INLINE void received () noexcept
 
void decode_buffers ()
 
SWC_CAN_INLINE bool expired (int64_t within=0) const noexcept
 
int32_t response_code () const noexcept
 
void print (std::ostream &out) const
 

Static Public Member Functions

static SWC_CAN_INLINE Ptr make (int error)
 

Public Attributes

int64_t expiry_ms
 
StaticBuffer data
 Primary data buffer. More...
 
StaticBuffer data_ext
 Extended buffer. More...
 
Header header
 
int error
 

Private Member Functions

SWC_CAN_INLINE Event (int a_error) noexcept
 

Detailed Description

Definition at line 20 of file Event.h.

Member Typedef Documentation

◆ Ptr

typedef std::shared_ptr<Event> SWC::Comm::Event::Ptr

Definition at line 33 of file Event.h.

Constructor & Destructor Documentation

◆ Event()

SWC_CAN_INLINE SWC::Comm::Event::Event ( int  a_error)
inlineexplicitprivatenoexcept

Definition at line 25 of file Event.h.

Referenced by make().

+ Here is the caller graph for this function:

◆ ~Event()

SWC::Comm::Event::~Event ( )
noexcept

Definition at line 15 of file Event.cc.

Member Function Documentation

◆ decode_buffers()

SWC_CAN_INLINE void SWC::Comm::Event::decode_buffers ( )

Definition at line 70 of file Event.h.

References SWC::Comm::Header::buffers, data, SWC::Comm::Header::data, data_ext, SWC::Comm::Header::data_ext, SWC::Comm::BufferInfo::decode(), error, SWC::Core::Buffer< T >::free(), header, SWC::LOG_WARN, SWC::Error::OK, print(), SWC::Error::REQUEST_TRUNCATED_PAYLOAD, SWC_LOG_OSTREAM, and SWC_LOG_OUT.

+ Here is the call graph for this function:

◆ expired()

SWC_CAN_INLINE bool SWC::Comm::Event::expired ( int64_t  within = 0) const
inlinenoexcept

Definition at line 51 of file Event.h.

References expiry_ms, and SWC::Time::now_ms().

+ Here is the call graph for this function:

◆ make()

static SWC_CAN_INLINE Ptr SWC::Comm::Event::make ( int  error)
inlinestatic

Definition at line 36 of file Event.h.

References error, and Event().

Referenced by SWC::Comm::ConnHandler::Receiver_HeaderPrefix::operator()(), SWC::Comm::ConnHandler::Sender_Ack::operator()(), SWC::FS::FileSystemBroker::send_request(), and SWC::Comm::ConnHandler::write().

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

◆ print()

void SWC::Comm::Event::print ( std::ostream &  out) const

Definition at line 36 of file Event.cc.

References data, data_ext, error, header, SWC::Comm::Header::print(), SWC::Error::print(), and SWC::Core::Buffer< T >::size.

Referenced by decode_buffers().

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

◆ received()

SWC_CAN_INLINE void SWC::Comm::Event::received ( )
inlinenoexcept

Definition at line 43 of file Event.h.

References expiry_ms, header, SWC::Time::now_ms(), and SWC::Comm::Header::timeout_ms.

+ Here is the call graph for this function:

◆ response_code()

int32_t SWC::Comm::Event::response_code ( ) const
noexcept

Definition at line 17 of file Event.cc.

References SWC::Core::Buffer< T >::base, SWC::Error::Exception::code(), data, SWC::Serialization::decode_i32(), error, SWC::LOG_ERROR, SWC::Core::Buffer< T >::size, SWC_CURRENT_EXCEPTION, SWC_LOG_OSTREAM, and SWC_LOG_OUT.

+ Here is the call graph for this function:

Member Data Documentation

◆ data

StaticBuffer SWC::Comm::Event::data

Primary data buffer.

Definition at line 60 of file Event.h.

Referenced by decode_buffers(), print(), and response_code().

◆ data_ext

StaticBuffer SWC::Comm::Event::data_ext

Extended buffer.

Definition at line 61 of file Event.h.

Referenced by decode_buffers(), and print().

◆ error

int SWC::Comm::Event::error

Definition at line 63 of file Event.h.

Referenced by decode_buffers(), make(), print(), and response_code().

◆ expiry_ms

int64_t SWC::Comm::Event::expiry_ms

Definition at line 59 of file Event.h.

Referenced by expired(), and received().

◆ header

Header SWC::Comm::Event::header

Definition at line 62 of file Event.h.

Referenced by decode_buffers(), print(), and received().


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