File: Bridge.h

package info (click to toggle)
atlas-cpp 0.5.98-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,652 kB
  • ctags: 2,284
  • sloc: sh: 8,305; cpp: 6,372; python: 1,471; makefile: 216
file content (110 lines) | stat: -rw-r--r-- 3,065 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// This file may be redistributed and modified only under the terms of
// the GNU Lesser General Public License (See COPYING for details).
// Copyright (C) 2000 Michael Day

#ifndef ATLAS_BRIDGE_H
#define ATLAS_BRIDGE_H

#include <string>

/** The Atlas namespace.

This namespace contains the whole of the Atlas-C++ library, and which is
divided into a hierarchy of other namespaces. The main namespaces of
interest to the application developers are the Atlas::Net namespace containing
classes to handle establishing network connections, and the Atlas::Objects
namespace containing classes used to handle high level Atlas data.
 */
namespace Atlas {

/** Atlas stream bridge

This class presents an interface that accepts an Atlas stream. The stream
begins with a call to streamBegin() and finishes with streamEnd(). While the
Bridge is in this stream context, a message can be sent using streamMessage().
This puts the Bridge into a map context, allowing various map*Item() calls.

Several classes are derived from Bridge, the most notable of which is Codec,
which accepts an Atlas stream for encoding and transmission.

@see Codec
*/

class Bridge
{
  public:
    virtual ~Bridge();

    // Interface for stream context

    /**
     *  Begin an Atlas stream.
     */
    virtual void streamBegin() = 0;
    /**
     *  Start a message in an Atlas stream.
     */
    virtual void streamMessage() = 0;
    /**
     *  Ends the Atlas stream.
     */
    virtual void streamEnd() = 0;
    
    // Interface for map context

    /**
     *  Starts a map object to the currently streamed map.
     */
    virtual void mapMapItem(const std::string& name) = 0;
    /**
     *  Starts a list object to the currently streamed map.
     */
    virtual void mapListItem(const std::string& name) = 0;
    /**
     *  Adds an integer to the currently streames map.
     */
    virtual void mapIntItem(const std::string& name, long) = 0;
    /**
     *  Adds a float to the currently streamed map.
     */
    virtual void mapFloatItem(const std::string& name, double) = 0;
    /**
     *  Adds a string to the currently streamed map.
     */
    virtual void mapStringItem(const std::string& name, const std::string&) = 0;
    /**
     *  Ends the currently streamed map.
     */
    virtual void mapEnd() = 0;
    
    // Interface for list context
    
    /**
     *  Starts a map object in the currently streamed list.
     */
    virtual void listMapItem() = 0;
    /**
     *  Starts a list object in the currently streamed list.
     */
    virtual void listListItem() = 0;
    /**
     *  Adds an integer to the currently streames list.
     */
    virtual void listIntItem(long) = 0;
    /**
     *  Adds a float to the currently streamed list.
     */
    virtual void listFloatItem(double) = 0;
    /**
     *  Adds a string to the currently streamed list.
     */
    virtual void listStringItem(const std::string&) = 0;
    /**
     *  Ends the currently streamed list.
     */
    virtual void listEnd() = 0;
};

} // Atlas namespace

#endif // ATLAS_BRIDGE_H