30 #ifndef __ZMQ_ENCODER_HPP_INCLUDED__ 31 #define __ZMQ_ENCODER_HPP_INCLUDED__ 67 buf = (
unsigned char*) malloc (bufsize_);
81 inline size_t encode (
unsigned char **data_,
size_t size_)
83 unsigned char *buffer = !*data_ ?
buf : *data_;
84 size_t buffersize = !*data_ ?
bufsize : size_;
90 while (pos < buffersize) {
104 (static_cast <T*> (
this)->*
next) ();
117 if (!pos && !*data_ &&
to_write >= buffersize) {
126 size_t to_copy = std::min (
to_write, buffersize - pos);
127 memcpy (buffer + pos,
write_pos, to_copy);
141 (static_cast <T*> (
this)->*
next) ();
151 inline void next_step (
void *write_pos_,
size_t to_write_,
152 step_t next_,
bool new_msg_flag_)
virtual ~encoder_base_t()
encoder_base_t(size_t bufsize_)
void next_step(void *write_pos_, size_t to_write_, step_t next_, bool new_msg_flag_)
size_t encode(unsigned char **data_, size_t size_)
void operator=(const encoder_base_t &)
void load_msg(msg_t *msg_)
unsigned char * write_pos