v2_decoder.hpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MPL-2.0 */
2 
3 #ifndef __ZMQ_V2_DECODER_HPP_INCLUDED__
4 #define __ZMQ_V2_DECODER_HPP_INCLUDED__
5 
6 #include "decoder.hpp"
7 #include "decoder_allocators.hpp"
8 
9 namespace zmq
10 {
11 // Decoder for ZMTP/2.x framing protocol. Converts data stream into messages.
12 // The class has to inherit from shared_message_memory_allocator because
13 // the base class calls allocate in its constructor.
14 class v2_decoder_t ZMQ_FINAL
15  : public decoder_base_t<v2_decoder_t, shared_message_memory_allocator>
16 {
17  public:
18  v2_decoder_t (size_t bufsize_, int64_t maxmsgsize_, bool zero_copy_);
19  ~v2_decoder_t ();
20 
21  // i_decoder interface.
22  msg_t *msg () { return &_in_progress; }
23 
24  private:
25  int flags_ready (unsigned char const *);
26  int one_byte_size_ready (unsigned char const *);
27  int eight_byte_size_ready (unsigned char const *);
28  int message_ready (unsigned char const *);
29 
30  int size_ready (uint64_t size_, unsigned char const *);
31 
32  unsigned char _tmpbuf[8];
33  unsigned char _msg_flags;
34  msg_t _in_progress;
35 
36  const bool _zero_copy;
37  const int64_t _max_msg_size;
38 
39  ZMQ_NON_COPYABLE_NOR_MOVABLE (v2_decoder_t)
40 };
41 }
42 
43 #endif
decoder_allocators.hpp
zmq
Definition: zmq.hpp:229
zmq::ZMQ_FINAL::_zero_copy
const bool _zero_copy
Definition: v2_decoder.hpp:36
ZMQ_NON_COPYABLE_NOR_MOVABLE
#define ZMQ_NON_COPYABLE_NOR_MOVABLE(classname)
Definition: macros.hpp:58
zmq::ZMQ_FINAL::msg
msg_t * msg()
Definition: v2_decoder.hpp:22
zmq::ZMQ_FINAL::_msg_flags
unsigned char _msg_flags
Definition: v2_decoder.hpp:33
decoder.hpp
ZMQ_FINAL
Definition: unittest_ip_resolver.cpp:26
zmq::msg_t
Definition: msg.hpp:33


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:07:01