Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | Related Pages

DecoderBase.h

00001 // This file may be redistributed and modified only under the terms of 00002 // the GNU Lesser General Public License (See COPYING for details). 00003 // Copyright (C) 2000 Stefanus Du Toit 00004 00005 #ifndef ATLAS_MESSAGE_DECODERBASE_H 00006 #define ATLAS_MESSAGE_DECODERBASE_H 00007 00008 #include <stack> 00009 #include <Atlas/Bridge.h> 00010 #include <Atlas/Message/Element.h> 00011 00012 namespace Atlas { namespace Message { 00013 00029 class DecoderBase : public Bridge 00030 { 00031 public: 00032 DecoderBase(); 00033 00034 virtual ~DecoderBase() {} 00035 00036 // Callback functions from Bridge 00037 virtual void streamBegin(); 00038 virtual void streamMessage(const Map&); 00039 virtual void streamEnd(); 00040 00041 virtual void mapItem(const std::string& name, const Map&); 00042 virtual void mapItem(const std::string& name, const List&); 00043 virtual void mapItem(const std::string& name, long); 00044 virtual void mapItem(const std::string& name, double); 00045 virtual void mapItem(const std::string& name, const std::string&); 00046 virtual void mapEnd(); 00047 00048 virtual void listItem(const Map&); 00049 virtual void listItem(const List&); 00050 virtual void listItem(long); 00051 virtual void listItem(double); 00052 virtual void listItem(const std::string&); 00053 virtual void listEnd(); 00054 00055 protected: 00056 00058 enum State { 00059 STATE_STREAM, 00060 STATE_MAP, 00061 STATE_LIST 00062 }; 00063 00065 std::stack<State> state; 00067 std::stack<Element::MapType> maps; 00069 std::stack<Element::ListType> lists; 00071 std::stack<std::string> names; 00072 00074 virtual void objectArrived(const Element& obj) = 0; 00075 }; 00076 00077 } } // namespace Atlas::Message 00078 00079 #endif

Copyright 2000 the respective authors.

This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.