<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>Atlas-C++: QueuedDecoder.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.4 --> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Atlas-C++</div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> </ul> </div> <div class="header"> <div class="headertitle"> <div class="title">QueuedDecoder.h</div> </div> </div> <div class="contents"> <div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// This file may be redistributed and modified only under the terms of</span> <a name="l00002"></a>00002 <span class="comment">// the GNU Lesser General Public License (See COPYING for details).</span> <a name="l00003"></a>00003 <span class="comment">// Copyright (C) 2000 Stefanus Du Toit</span> <a name="l00004"></a>00004 <a name="l00005"></a>00005 <span class="comment">// $Id$</span> <a name="l00006"></a>00006 <a name="l00007"></a>00007 <span class="preprocessor">#ifndef ATLAS_MESSAGE_QUEUEDDECODER_H</span> <a name="l00008"></a>00008 <span class="preprocessor"></span><span class="preprocessor">#define ATLAS_MESSAGE_QUEUEDDECODER_H</span> <a name="l00009"></a>00009 <span class="preprocessor"></span> <a name="l00010"></a>00010 <span class="preprocessor">#include <Atlas/Message/DecoderBase.h></span> <a name="l00011"></a>00011 <span class="preprocessor">#include <Atlas/Message/Element.h></span> <a name="l00012"></a>00012 <a name="l00013"></a>00013 <span class="preprocessor">#include <queue></span> <a name="l00014"></a>00014 <a name="l00015"></a>00015 <span class="keyword">namespace </span>Atlas { <span class="keyword">namespace </span>Message { <a name="l00016"></a>00016 <a name="l00017"></a>00017 <span class="keyword">class </span>Element; <a name="l00018"></a>00018 <a name="l00019"></a>00019 <span class="keyword">typedef</span> std::map<std::string, Element> MapType; <a name="l00020"></a>00020 <a name="l00034"></a><a class="code" href="class_atlas_1_1_message_1_1_queued_decoder.html">00034</a> <span class="keyword">class </span><a class="code" href="class_atlas_1_1_message_1_1_queued_decoder.html" title="Decoder that presents a queue of Atlas::Message::Element.">QueuedDecoder</a> : <span class="keyword">public</span> <a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html" title="Base class for decoders that take Atlas::Message::Object.">DecoderBase</a> <a name="l00035"></a>00035 { <a name="l00036"></a>00036 <span class="keyword">public</span>: <a name="l00037"></a>00037 <a name="l00038"></a>00038 <a class="code" href="class_atlas_1_1_message_1_1_queued_decoder.html" title="Decoder that presents a queue of Atlas::Message::Element.">QueuedDecoder</a>(); <a name="l00039"></a>00039 <a name="l00041"></a><a class="code" href="class_atlas_1_1_message_1_1_queued_decoder.html#aa186b748c8354f352f0a4f2e5e183730">00041</a> <span class="keywordtype">size_t</span> <a class="code" href="class_atlas_1_1_message_1_1_queued_decoder.html#aa186b748c8354f352f0a4f2e5e183730" title="Retrieve the current size of the message queue.">queueSize</a>() { <a name="l00042"></a>00042 <span class="keywordflow">return</span> m_objectQueue.size(); <a name="l00043"></a>00043 } <a name="l00045"></a><a class="code" href="class_atlas_1_1_message_1_1_queued_decoder.html#a69a25e892d37ac2b1d54df5897fc73c5">00045</a> <span class="keyword">const</span> MapType <a class="code" href="class_atlas_1_1_message_1_1_queued_decoder.html#a69a25e892d37ac2b1d54df5897fc73c5" title="Pop an object from the front of the message queue.">popMessage</a>() { <a name="l00046"></a>00046 MapType r = m_objectQueue.front(); <a name="l00047"></a>00047 m_objectQueue.pop(); <a name="l00048"></a>00048 <span class="keywordflow">return</span> r; <a name="l00049"></a>00049 } <a name="l00051"></a><a class="code" href="class_atlas_1_1_message_1_1_queued_decoder.html#a4ea51b410b4c70cccbcc3485a4050889">00051</a> <span class="keyword">const</span> MapType <a class="code" href="class_atlas_1_1_message_1_1_queued_decoder.html#a4ea51b410b4c70cccbcc3485a4050889" title="Peek at the object at the front of the queue.">frontMessage</a>() { <a name="l00052"></a>00052 <span class="keywordflow">return</span> m_objectQueue.front(); <a name="l00053"></a>00053 } <a name="l00055"></a>00055 <span class="keywordtype">void</span> <a class="code" href="class_atlas_1_1_message_1_1_queued_decoder.html#ab6f0f82ddb6aaa8cd3e18e709f8a8e48" title="Clear the message queue.">clearQueue</a>(); <a name="l00056"></a>00056 <a name="l00057"></a>00057 <span class="keyword">protected</span>: <a name="l00058"></a>00058 <a name="l00060"></a>00060 <span class="keywordtype">void</span> <a class="code" href="class_atlas_1_1_message_1_1_queued_decoder.html#abac6b4693dfd60303a870fdf4aab2430" title="This adds a message to the queue.">messageArrived</a>(<span class="keyword">const</span> MapType& obj); <a name="l00061"></a>00061 <a name="l00062"></a>00062 <span class="keyword">private</span>: <a name="l00063"></a>00063 <a name="l00064"></a>00064 std::queue<MapType> m_objectQueue; <a name="l00065"></a>00065 }; <a name="l00066"></a>00066 <a name="l00067"></a>00067 } } <span class="comment">// namespace Atlas::Message</span> <a name="l00068"></a>00068 <a name="l00069"></a>00069 <span class="preprocessor">#endif</span> </pre></div></div> </div> <HR> <P>Copyright 2000-2004 the respective authors.</P> <P>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.</P>