Atlas  0.7.0
Networking protocol for the Worldforge system.
MEncoder.h
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 // $Id$
6 
7 #ifndef ATLAS_MESSAGE_ENCODER_H
8 #define ATLAS_MESSAGE_ENCODER_H
9 
10 #include <Atlas/EncoderBase.h>
11 
12 #include <map>
13 #include <vector>
14 #include <string>
15 
16 namespace Atlas { namespace Message {
17 
18 class Element;
19 
20 typedef std::map<std::string, Element> MapType;
21 typedef std::vector<Element> ListType;
22 
34 {
35 public:
36  explicit Encoder(Atlas::Bridge &);
37 
38  ~Encoder() override = default;
39 
41  void streamMessageElement(const MapType & obj);
43  void mapElementItem(const std::string&, const Element&);
44  void mapElementMapItem(const std::string&, const MapType&);
45  void mapElementListItem(const std::string&, const ListType&);
47  void listElementItem(const Element&);
48  void listElementMapItem(const MapType&);
49  void listElementListItem(const ListType&);
50 };
51 
52 } } // namespace Atlas::Message
53 
54 #endif
Atlas::EncoderBase
Definition: EncoderBase.h:30
Atlas::Message::Encoder::streamMessageElement
void streamMessageElement(const MapType &obj)
Send a message (must be a map!) in stream state.
Definition: MEncoder.cpp:114
Atlas::Message::Element
Definition: Element.h:38
Atlas::Bridge
Definition: Bridge.h:35
Atlas::Message::Encoder::mapElementItem
void mapElementItem(const std::string &, const Element &)
Send an object as a map item.
Definition: MEncoder.cpp:66
Atlas::Message::Encoder::listElementItem
void listElementItem(const Element &)
Send an object as a list item.
Definition: MEncoder.cpp:19
Atlas::Message::Encoder
Definition: MEncoder.h:33
Atlas
Definition: Bridge.h:20