i_encoder.hpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MPL-2.0 */
2 
3 #ifndef __ZMQ_I_ENCODER_HPP_INCLUDED__
4 #define __ZMQ_I_ENCODER_HPP_INCLUDED__
5 
6 #include "macros.hpp"
7 #include "stdint.hpp"
8 
9 namespace zmq
10 {
11 // Forward declaration
12 class msg_t;
13 
14 // Interface to be implemented by message encoder.
15 
16 struct i_encoder
17 {
18  virtual ~i_encoder () ZMQ_DEFAULT;
19 
20  // The function returns a batch of binary data. The data
21  // are filled to a supplied buffer. If no buffer is supplied (data_
22  // is NULL) encoder will provide buffer of its own.
23  // Function returns 0 when a new message is required.
24  virtual size_t encode (unsigned char **data_, size_t size_) = 0;
25 
26  // Load a new message into encoder.
27  virtual void load_msg (msg_t *msg_) = 0;
28 };
29 }
30 
31 #endif
data_
StringPiece data_
Definition: bytestream_unittest.cc:60
ZMQ_DEFAULT
#define ZMQ_DEFAULT
Definition: macros.hpp:43
zmq::i_encoder
Definition: i_encoder.hpp:16
zmq
Definition: zmq.hpp:229
zmq::i_encoder::encode
virtual size_t encode(unsigned char **data_, size_t size_)=0
macros.hpp
stdint.hpp
zmq::i_encoder::load_msg
virtual void load_msg(msg_t *msg_)=0
zmq::i_encoder::~i_encoder
virtual ~i_encoder() ZMQ_DEFAULT
zmq::msg_t
Definition: msg.hpp:33


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:54