ztsdb
Public Member Functions | Public Attributes | List of all members
zcore::Encode Struct Reference

#include <encode.hpp>

Public Member Functions

 Encode (net::NetHandler &c, Global::conn_id_t peerid_p, Global::reqid_t reqid_p, Global::reqid_t sourceid_p, Global::MsgType msgt_p)
 
Encodeoperator<< (const val::Value &v)
 
Encodeoperator<< (const E *e)
 
template<typename T >
Encodeoperator<< (const T &t)
 
template<typename T >
Encodeoperator<< (const arr::Array< T > &t)
 
Encodeoperator<< (const val::VI &t)
 
Encodeoperator<< (const string &t)
 
Encodeoperator<< (const arr::zstring &t)
 
Encodeoperator<< (const tz::interval &t)
 
Encodeoperator<< (const tz::period &t)
 
Encodeoperator<< (const arr::zts &t)
 
Encodeoperator<< (const bool t)
 
ssize_t flush ()
 
ssize_t flush_end ()
 

Public Attributes

net::NetHandlercom
 
const Global::conn_id_t peerid
 
const Global::reqid_t reqid
 
const Global::reqid_t sourceid
 
const Global::MsgType msgt
 
char buf [Global::CHUNKSZ]
 
size_t offset
 
size_t bytes
 

Detailed Description

This class handles the encoding/decoding of a message. A 'message' is a layer of abstraction above the chunk, itself a layer above the TCP segment (the reassembly of which is handled by NetHandler). An encode object is created each time a message of a given type (e.g. REQ, RSP) is sent. It handles the encoding of the contents and their (outgoing) segmentation in chunks. It also handles the reassembly of code buffers and the ongoing construction of a transmitted value. The main implementation goal is to avoid any copy of incoming and outgoing objects. Outgoing objects are sent in chunks straight from the object and incoming objects are reconstructed in place from chunks.


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