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