~ubuntu-branches/ubuntu/breezy/atlas-cpp/breezy

« back to all changes in this revision

Viewing changes to Atlas/Message/Encoder.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Koch
  • Date: 2005-10-02 11:41:44 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051002114144-8qmn4d1cdn9g27ta
Tags: 0.5.98-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// This file may be redistributed and modified only under the terms of
2
 
// the GNU Lesser General Public License (See COPYING for details).
3
 
// Copyright (C) 2000 Stefanus Du Toit
4
 
 
5
 
#ifndef ATLAS_MESSAGE_ENCODER_H
6
 
#define ATLAS_MESSAGE_ENCODER_H
7
 
 
8
 
#include <Atlas/EncoderBase.h>
9
 
 
10
 
namespace Atlas { namespace Message {
11
 
 
12
 
class Element;
13
 
 
14
 
/** Encoder that transmits Atlas::Message::Element.
15
 
 *
16
 
 * This encoder can be used to send Atlas::Message::Element objects representing
17
 
 * full atlas messages.
18
 
 *
19
 
 * @see Element
20
 
 * @see Atlas::Bridge
21
 
 * @see Atlas::EncoderBase
22
 
 * @author Stefanus Du Toit <sdt@gmx.net>
23
 
 */
24
 
class Encoder : public Atlas::EncoderBase
25
 
{
26
 
public:
27
 
    Encoder(Atlas::Bridge*);
28
 
 
29
 
    virtual ~Encoder() { }
30
 
 
31
 
    /// Ensure that methods in base class are not hidden
32
 
    virtual void streamMessage(const Map& m)
33
 
    { EncoderBase::streamMessage(m); }
34
 
 
35
 
    virtual void mapItem(const std::string& name, const Bridge::Map& m)
36
 
    { EncoderBase::mapItem(name, m); }
37
 
    virtual void mapItem(const std::string& name, const Bridge::List& l)
38
 
    { EncoderBase::mapItem(name, l); }
39
 
    virtual void mapItem(const std::string& name, long i)
40
 
    { EncoderBase::mapItem(name, i); }
41
 
    virtual void mapItem(const std::string& name, double d)
42
 
    { EncoderBase::mapItem(name, d); }
43
 
    virtual void mapItem(const std::string& name, const std::string& s)
44
 
    { EncoderBase::mapItem(name, s); }
45
 
 
46
 
    virtual void listItem(const Bridge::Map& m) { EncoderBase::listItem(m); }
47
 
    virtual void listItem(const Bridge::List& l) { EncoderBase::listItem(l); }
48
 
    virtual void listItem(long i) { EncoderBase::listItem(i); }
49
 
    virtual void listItem(double d) { EncoderBase::listItem(d); }
50
 
    virtual void listItem(const std::string& s) { EncoderBase::listItem(s); }
51
 
 
52
 
    /// Send a message (must be a map!) in stream state.
53
 
    virtual void streamMessage(const Element& obj);
54
 
 
55
 
    /// Send an object as a map item.
56
 
    virtual void mapItem(const std::string&, const Element&);
57
 
    /// Send an object as a list item.
58
 
    virtual void listItem(const Element&);
59
 
};
60
 
 
61
 
} } // namespace Atlas::Message
62
 
 
63
 
#endif
64
 
 
65