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_QUEUEDDECODER_H 00006 #define ATLAS_MESSAGE_QUEUEDDECODER_H 00007 00008 #include <Atlas/Message/DecoderBase.h> 00009 #include <Atlas/Message/Element.h> 00010 00011 #include <queue> 00012 00013 namespace Atlas { namespace Message { 00014 00015 class Element; 00016 00017 typedef std::map<std::string, Element> MapType; 00018 00032 class QueuedDecoder : public DecoderBase 00033 { 00034 public: 00035 00036 QueuedDecoder(); 00037 00039 size_t queueSize() { 00040 return m_objectQueue.size(); 00041 } 00043 const MapType popMessage() { 00044 MapType r = m_objectQueue.front(); 00045 m_objectQueue.pop(); 00046 return r; 00047 } 00049 const MapType frontMessage() { 00050 return m_objectQueue.front(); 00051 } 00053 void clearQueue(); 00054 00055 protected: 00056 00058 void messageArrived(const MapType& obj); 00059 00060 private: 00061 00062 std::queue<MapType> m_objectQueue; 00063 }; 00064 00065 } } // namespace Atlas::Message 00066 00067 #endif
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.