SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
Header.h File Reference
+ Include dependency graph for Header.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SWC::Comm::Header
 

Namespaces

 SWC
 The SWC-DB C++ namespace 'SWC'.
 
 SWC::Comm
 The SWC-DB Communications C++ namespace 'SWC::Comm'.
 

Functions

struct SWC::Comm::Header SWC::Comm::__attribute__ ((packed))
 
 Header (uint64_t cmd=0, uint32_t timeout=0) noexcept
 
 Header (const Header &init_from_req_header) noexcept
 
 ~Header () noexcept
 
void reset () noexcept
 
void set (uint64_t cmd=0, uint32_t timeout=0) noexcept
 
uint8_t encoded_length () noexcept
 
void encode (uint8_t **bufp) const
 
void decode_prefix (const uint8_t **bufp, size_t *remainp)
 
void decode (const uint8_t **bufp, size_t *remainp)
 
void initialize_from_response (const Header &header)
 
void initialize_from_request (const Header &header)
 
void print (std::ostream &out) const
 

Variables

static const uint8_t PROTOCOL_VERSION = 1
 
static const uint8_t PREFIX_LENGTH = 2
 
static const uint8_t FIXED_LENGTH = PREFIX_LENGTH + 16
 
static const uint8_t MAX_LENGTH = FIXED_LENGTH + 15 * 2
 
static const uint8_t FLAG_REQUEST_BIT = 0x01
 
static const uint8_t FLAG_REQUEST_MASK = 0xFE
 
static const uint8_t FLAG_RESPONSE_IGNORE_BIT = 0x02
 
static const uint8_t FLAG_RESPONSE_PARTIAL_BIT = 0x04
 
static const uint8_t FLAG_RESPONSE_PARTIAL_MASK = 0xFB
 
uint8_t version
 Protocol version. More...
 
uint8_t header_len
 Length of header. More...
 
uint8_t flags
 Flags. More...
 
uint8_t buffers
 number of buffers from 0 to 2 (data+data_ext) More...
 
uint32_t id
 Request ID. More...
 
uint32_t timeout_ms
 Request timeout. More...
 
uint32_t checksum
 Header checksum (excl. it self) More...
 
uint16_t command
 Request command number. More...
 
BufferInfo data
 Data Buffer. More...
 
BufferInfo data_ext
 Data Extended Buffer. More...
 

Function Documentation

◆ decode()

◆ decode_prefix()

void __attribute__::decode_prefix ( const uint8_t **  bufp,
size_t *  remainp 
)

◆ encode()

void __attribute__::encode ( uint8_t **  bufp) const

Definition at line 24 of file HeaderBufferInfo.h.

Referenced by SWC::DB::Cell::Serial::Value::FieldUpdate_Ext< UpdateField_T >::ext_encode().

+ Here is the caller graph for this function:

◆ encoded_length()

uint8_t __attribute__::encoded_length ( )
noexcept

◆ Header() [1/2]

__attribute__::Header ( const Header &  init_from_req_header)
explicitnoexcept

Definition at line 20 of file Header.h.

◆ Header() [2/2]

__attribute__::Header ( uint64_t  cmd = 0,
uint32_t  timeout = 0 
)
noexcept

Definition at line 14 of file Header.h.

◆ initialize_from_request()

void __attribute__::initialize_from_request ( const Header header)

◆ initialize_from_response()

void __attribute__::initialize_from_response ( const Header header)

◆ print()

void __attribute__::print ( std::ostream &  out) const

Referenced by SWC::DB::Cell::Serial::Value::FieldUpdate_Ext< UpdateField_T >::ext_print().

+ Here is the caller graph for this function:

◆ reset()

void __attribute__::reset ( )
noexcept

Definition at line 10 of file HeaderBufferInfo.h.

Referenced by SWC::client::Query::Update::Handlers::Base::get_resend_count().

+ Here is the caller graph for this function:

◆ set()

◆ ~Header()

__attribute__::~Header ( )
noexcept

Definition at line 29 of file Header.h.

Variable Documentation

◆ buffers

uint8_t buffers

number of buffers from 0 to 2 (data+data_ext)

Definition at line 56 of file Header.h.

Referenced by SWC::Comm::ConnHandlerPlain::do_async_write(), SWC::Comm::ConnHandlerSSL::do_async_write(), and SWC::Comm::Buffers::get_buffers().

◆ checksum

uint32_t checksum

◆ command

uint16_t command

Request command number.

Definition at line 60 of file Header.h.

Referenced by main().

◆ data

BufferInfo data

Data Buffer.

Definition at line 62 of file Header.h.

◆ data_ext

BufferInfo data_ext

Data Extended Buffer.

Definition at line 63 of file Header.h.

◆ FIXED_LENGTH

const uint8_t FIXED_LENGTH = PREFIX_LENGTH + 16
static

Definition at line 3 of file Header.h.

◆ FLAG_REQUEST_BIT

const uint8_t FLAG_REQUEST_BIT = 0x01
static

Definition at line 6 of file Header.h.

◆ FLAG_REQUEST_MASK

const uint8_t FLAG_REQUEST_MASK = 0xFE
static

Definition at line 7 of file Header.h.

◆ FLAG_RESPONSE_IGNORE_BIT

const uint8_t FLAG_RESPONSE_IGNORE_BIT = 0x02
static

Definition at line 9 of file Header.h.

◆ FLAG_RESPONSE_PARTIAL_BIT

const uint8_t FLAG_RESPONSE_PARTIAL_BIT = 0x04
static

Definition at line 10 of file Header.h.

◆ FLAG_RESPONSE_PARTIAL_MASK

const uint8_t FLAG_RESPONSE_PARTIAL_MASK = 0xFB
static

Definition at line 11 of file Header.h.

◆ flags

◆ header_len

uint8_t header_len

Length of header.

Definition at line 53 of file Header.h.

◆ id

uint32_t id

Request ID.

Definition at line 57 of file Header.h.

Referenced by SWC::ThriftBroker::AppHandler::updater_create().

◆ MAX_LENGTH

const uint8_t MAX_LENGTH = FIXED_LENGTH + 15 * 2
static

Definition at line 4 of file Header.h.

◆ PREFIX_LENGTH

const uint8_t PREFIX_LENGTH = 2
static

Definition at line 2 of file Header.h.

◆ PROTOCOL_VERSION

const uint8_t PROTOCOL_VERSION = 1
static

Definition at line 1 of file Header.h.

◆ timeout_ms

uint32_t timeout_ms

Request timeout.

Definition at line 58 of file Header.h.

Referenced by SWC::Thrift::Client::make(), and SWC::ThriftBroker::make_service().

◆ version

uint8_t version

Protocol version.

Definition at line 52 of file Header.h.