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 Michael Day
5
#include <Atlas/Net/Loopback.h>
6
#include <Atlas/Bridge.h>
10
class LoopBridge : public Bridge
14
LoopBridge(Bridge* bridge) : bridge(bridge) { }
16
virtual void streamBegin()
18
bridge->streamBegin();
21
virtual void streamMessage(const Map&)
23
bridge->streamMessage(MapBegin);
26
virtual void streamEnd()
31
virtual void mapItem(const std::string& name, const Map&)
33
bridge->mapItem(name, MapBegin);
36
virtual void mapItem(const std::string& name, const List&)
38
bridge->mapItem(name, ListBegin);
41
virtual void mapItem(const std::string& name, long data)
43
bridge->mapItem(name, data);
46
virtual void mapItem(const std::string& name, double data)
48
bridge->mapItem(name, data);
51
virtual void mapItem(const std::string& name, const std::string& data)
53
bridge->mapItem(name, data);
61
virtual void listItem(const Map&)
63
bridge->listItem(MapBegin);
66
virtual void listItem(const List&)
68
bridge->listItem(ListBegin);
71
virtual void listItem(long data)
73
bridge->listItem(data);
76
virtual void listItem(double data)
78
bridge->listItem(data);
81
virtual void listItem(const std::string& data)
83
bridge->listItem(data);
86
virtual void listEnd()
96
void Atlas::Net::Loopback(Bridge* d1, Bridge* d2, Bridge*& e1, Bridge*& e2)
98
e1 = new LoopBridge(d1);
99
e2 = new LoopBridge(d2);