source: subversion/applications/utils/tirex/backend-mapnik/networkmessage.h @ 29342

Last change on this file since 29342 was 21343, checked in by jochen, 9 years ago

renamed backends in syslog messages

File size: 1.3 KB
Line 
1/*
2 * Tirex Tile Rendering System
3 *
4 * Mapnik rendering backend
5 *
6 * Originally written by Jochen Topf & Frederik Ramm.
7 *
8 */
9
10/**
11 * NetworkMessage
12 *
13 * Superclass for messages of the Tirex network protocol. Protocol
14 * messages consist of a series of lines, ending with LF or CRLF, and
15 * each line contains a plain-text key, followed by an equal sign, and
16 * a plain-text value. Keys must not contain equal signs; lines without
17 * equal signs are ignored; the order does not matter; and neither keys
18 * nor values may contain CR or LF.
19 *
20 * Example message:
21 *
22 * request=render
23 * type=metatile
24 * map=default
25 * x=16
26 * y=24
27 * z=5
28 */
29
30#ifndef networkmessage_included
31#define networkmessage_included
32
33#include "debuggable.h"
34
35#include <string>
36#include <map>
37
38class NetworkMessage : public Debuggable
39{
40    private:
41        std::map<std::string, std::string> mParams;
42
43    public:
44        NetworkMessage();
45        ~NetworkMessage();
46        bool parse(const std::string &buffer);
47        bool build(std::string &buffer) const;
48        const std::string getParam(const std::string &key, const std::string &def) const;
49        int getParam(const std::string &key, int def) const;
50        void setParam(const std::string &key, const std::string &value);
51        void setParam(const std::string &key, int value);
52};
53
54#endif
Note: See TracBrowser for help on using the repository browser.