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
16namespace Atlas { namespace Message {
17
18class Element;
19
20typedef std::map<std::string, Element> MapType;
21typedef std::vector<Element> ListType;
22
34{
35public:
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
void listElementItem(const Element &)
Send an object as a list item.
Definition: MEncoder.cpp:19
void mapElementItem(const std::string &, const Element &)
Send an object as a map item.
Definition: MEncoder.cpp:66
void streamMessageElement(const MapType &obj)
Send a message (must be a map!) in stream state.
Definition: MEncoder.cpp:114
Definition: Bridge.h:20