~ubuntu-branches/ubuntu/precise/zeromq/precise

« back to all changes in this revision

Viewing changes to src/zmq_decoder.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Martin Lucina
  • Date: 2011-05-13 12:43:09 UTC
  • mfrom: (7.2.1 sid)
  • Revision ID: james.westby@ubuntu.com-20110513124309-m3gdt964ga67rcwu
Tags: 2.1.7-1
* New upstream version. (closes: #619374)
* --with-system-pgm is now used instead of the embedded OpenPGM library. 
* Added Debian watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
    Copyright (c) 2007-2010 iMatix Corporation
3
 
 
4
 
    This file is part of 0MQ.
5
 
 
6
 
    0MQ is free software; you can redistribute it and/or modify it under
7
 
    the terms of the Lesser GNU General Public License as published by
8
 
    the Free Software Foundation; either version 3 of the License, or
9
 
    (at your option) any later version.
10
 
 
11
 
    0MQ is distributed in the hope that it will be useful,
12
 
    but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
    Lesser GNU General Public License for more details.
15
 
 
16
 
    You should have received a copy of the Lesser GNU General Public License
17
 
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
 
*/
19
 
 
20
 
#ifndef __ZMQ_ZMQ_DECODER_HPP_INCLUDED__
21
 
#define __ZMQ_ZMQ_DECODER_HPP_INCLUDED__
22
 
 
23
 
#include "../include/zmq.h"
24
 
 
25
 
#include "decoder.hpp"
26
 
#include "blob.hpp"
27
 
 
28
 
namespace zmq
29
 
{
30
 
    //  Decoder for 0MQ backend protocol. Converts data batches into messages.
31
 
 
32
 
    class zmq_decoder_t : public decoder_t <zmq_decoder_t>
33
 
    {
34
 
    public:
35
 
 
36
 
        zmq_decoder_t (size_t bufsize_);
37
 
        ~zmq_decoder_t ();
38
 
 
39
 
        void set_inout (struct i_inout *destination_);
40
 
 
41
 
    private:
42
 
 
43
 
        bool one_byte_size_ready ();
44
 
        bool eight_byte_size_ready ();
45
 
        bool flags_ready ();
46
 
        bool message_ready ();
47
 
 
48
 
        struct i_inout *destination;
49
 
        unsigned char tmpbuf [8];
50
 
        ::zmq_msg_t in_progress;
51
 
 
52
 
        zmq_decoder_t (const zmq_decoder_t&);
53
 
        void operator = (const zmq_decoder_t&);
54
 
    };
55
 
 
56
 
}
57
 
 
58
 
#endif
59