2
Copyright (c) 2007-2012 iMatix Corporation
3
Copyright (c) 2007-2012 Other contributors as noted in the AUTHORS file
5
This file is part of 0MQ.
7
0MQ is free software; you can redistribute it and/or modify it under
8
the terms of the GNU Lesser General Public License as published by
9
the Free Software Foundation; either version 3 of the License, or
10
(at your option) any later version.
12
0MQ is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU Lesser General Public License for more details.
17
You should have received a copy of the GNU Lesser General Public License
18
along with this program. If not, see <http://www.gnu.org/licenses/>.
21
#ifndef __ZMQ_I_ENCODER_HPP_INCLUDED__
22
#define __ZMQ_I_ENCODER_HPP_INCLUDED__
29
// Forward declaration
32
// Interface to be implemented by message encoder.
36
virtual ~i_encoder () {}
38
// Set message producer.
39
virtual void set_msg_source (i_msg_source *msg_source_) = 0;
41
// The function returns a batch of binary data. The data
42
// are filled to a supplied buffer. If no buffer is supplied (data_
43
// is NULL) encoder will provide buffer of its own.
44
// If offset is not NULL, it is filled by offset of the first message
45
// in the batch.If there's no beginning of a message in the batch,
46
// offset is set to -1.
47
virtual void get_data (unsigned char **data_, size_t *size_,
48
int *offset_ = NULL) = 0;