Atlas-C++
EncoderBase.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_ENCODERBASE_H
8 #define ATLAS_ENCODERBASE_H
9 
10 #include <Atlas/Bridge.h>
11 
12 namespace Atlas {
13 
30 class EncoderBase { // : public Atlas::Bridge {
31 public:
32 
34  explicit EncoderBase(Atlas::Bridge & b) : m_b(b) { }
35 
36  virtual ~EncoderBase() = default;
37 
38  void streamBegin() { m_b.streamBegin(); }
39  void streamMessage() { m_b.streamMessage(); }
40  void streamEnd() { m_b.streamEnd(); }
41 
42  void mapMapItem(const std::string& name)
43  { m_b.mapMapItem(name); }
44  void mapListItem(const std::string& name)
45  { m_b.mapListItem(name); }
46  void mapIntItem(const std::string& name, long i)
47  { m_b.mapIntItem(name, i); }
48  void mapFloatItem(const std::string& name, double d)
49  { m_b.mapFloatItem(name, d); }
50  void mapStringItem(const std::string& name, const std::string& s)
51  { m_b.mapStringItem(name, s); }
52  void mapEnd()
53  { m_b.mapEnd(); }
54 
55  void listMapItem() { m_b.listMapItem(); }
56  void listListItem() { m_b.listListItem(); }
57  void listIntItem(long i) { m_b.listIntItem(i); }
58  void listFloatItem(double d) { m_b.listFloatItem(d); }
59  void listStringItem(const std::string& s) { m_b.listStringItem(s); }
60  void listEnd() { m_b.listEnd(); }
61 
62 protected:
65 };
66 
67 } // namespace Atlas
68 
69 #endif // ATLAS_ENCODERBASE_H
virtual void listListItem()=0
Starts a list object in the currently streamed list.
virtual void listStringItem(std::string)=0
Adds a string to the currently streamed list.
virtual void streamMessage()=0
Start a message in an Atlas stream.
virtual void mapIntItem(std::string name, long)=0
Adds an integer to the currently streames map.
EncoderBase(Atlas::Bridge &b)
You will need to implement this in subclasses.
Definition: EncoderBase.h:34
Atlas stream bridge.
Definition: Bridge.h:35
virtual void listMapItem()=0
Starts a map object in the currently streamed list.
virtual void mapFloatItem(std::string name, double)=0
Adds a float to the currently streamed map.
virtual void listEnd()=0
Ends the currently streamed list.
virtual void mapEnd()=0
Ends the currently streamed map.
virtual void mapListItem(std::string name)=0
Starts a list object to the currently streamed map.
virtual void listIntItem(long)=0
Adds an integer to the currently streames list.
The Atlas namespace.
Definition: Bridge.h:20
virtual void streamEnd()=0
Ends the Atlas stream.
Atlas::Bridge & m_b
The bridge that requests are forwarded to.
Definition: EncoderBase.h:64
virtual void listFloatItem(double)=0
Adds a float to the currently streamed list.
virtual void mapMapItem(std::string name)=0
Starts a map object to the currently streamed map.
Base class forwarding to Atlas::Bridge as skeleton for other encoders.
Definition: EncoderBase.h:30
virtual void streamBegin()=0
Begin an Atlas stream.
virtual void mapStringItem(std::string name, std::string)=0
Adds a string to the currently streamed map.

Copyright 2000-2004 the respective authors.

This document can be licensed under the terms of the GNU Free Documentation License or the GNU General Public License and may be freely distributed under the terms given by one of these licenses.