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 
35 
36  virtual ~EncoderBase() { }
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
Atlas::Bridge::listMapItem
virtual void listMapItem()=0
Starts a map object in the currently streamed list.
Atlas::Bridge
Atlas stream bridge.
Definition: Bridge.h:36
Atlas::EncoderBase::m_b
Atlas::Bridge & m_b
The bridge that requests are forwarded to.
Definition: EncoderBase.h:64
Atlas::Bridge::mapIntItem
virtual void mapIntItem(const std::string &name, long)=0
Adds an integer to the currently streames map.
Atlas::Bridge::streamBegin
virtual void streamBegin()=0
Begin an Atlas stream.
Atlas::Bridge::listIntItem
virtual void listIntItem(long)=0
Adds an integer to the currently streames list.
Atlas::Bridge::listEnd
virtual void listEnd()=0
Ends the currently streamed list.
Atlas::EncoderBase::EncoderBase
EncoderBase(Atlas::Bridge &b)
You will need to implement this in subclasses.
Definition: EncoderBase.h:34
Atlas::Bridge::mapListItem
virtual void mapListItem(const std::string &name)=0
Starts a list object to the currently streamed map.
Atlas::Bridge::listFloatItem
virtual void listFloatItem(double)=0
Adds a float to the currently streamed list.
Atlas::Bridge::mapEnd
virtual void mapEnd()=0
Ends the currently streamed map.
Atlas::Bridge::listStringItem
virtual void listStringItem(const std::string &)=0
Adds a string to the currently streamed list.
Atlas::Bridge::streamEnd
virtual void streamEnd()=0
Ends the Atlas stream.
Atlas::Bridge::listListItem
virtual void listListItem()=0
Starts a list object in the currently streamed list.
Atlas
The Atlas namespace.
Definition: Bridge.h:20
Atlas::Bridge::streamMessage
virtual void streamMessage()=0
Start a message in an Atlas stream.
Atlas::Bridge::mapMapItem
virtual void mapMapItem(const std::string &name)=0
Starts a map object to the currently streamed map.
Atlas::Bridge::mapStringItem
virtual void mapStringItem(const std::string &name, const std::string &)=0
Adds a string to the currently streamed map.
Atlas::Bridge::mapFloatItem
virtual void mapFloatItem(const std::string &name, double)=0
Adds a float to the currently streamed map.
Atlas::EncoderBase
Base class forwarding to Atlas::Bridge as skeleton for other encoders.
Definition: EncoderBase.h:30

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.