mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-29 20:59:47 +01:00
Refactor code so that messages go through engines
This commit is contained in:
@@ -26,7 +26,7 @@ namespace zmq
|
||||
{
|
||||
|
||||
// Forward declaration
|
||||
class i_msg_source;
|
||||
class msg_t;
|
||||
|
||||
// Interface to be implemented by message encoder.
|
||||
|
||||
@@ -34,17 +34,14 @@ namespace zmq
|
||||
{
|
||||
virtual ~i_encoder () {}
|
||||
|
||||
// Set message producer.
|
||||
virtual void set_msg_source (i_msg_source *msg_source_) = 0;
|
||||
|
||||
// The function returns a batch of binary data. The data
|
||||
// are filled to a supplied buffer. If no buffer is supplied (data_
|
||||
// is NULL) encoder will provide buffer of its own.
|
||||
// If offset is not NULL, it is filled by offset of the first message
|
||||
// in the batch.If there's no beginning of a message in the batch,
|
||||
// offset is set to -1.
|
||||
virtual void get_data (unsigned char **data_, size_t *size_,
|
||||
int *offset_ = NULL) = 0;
|
||||
// Function returns 0 when a new message is required.
|
||||
virtual size_t encode (unsigned char **data_, size_t size) = 0;
|
||||
|
||||
// Load a new message into encoder.
|
||||
virtual void load_msg (msg_t *msg_) = 0;
|
||||
|
||||
virtual bool has_data () = 0;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user