Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > c200d180bc1063a7706e0da42a546b51 > files > 67

atlascpp-devel-0.6.1-7.fc12.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Atlas-C++: DecoderBase.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.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;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 class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
    </ul>
  </div>
<h1>DecoderBase.h</h1><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="preprocessor">#ifndef ATLAS_MESSAGE_DECODERBASE_H</span>
<a name="l00006"></a>00006 <span class="preprocessor"></span><span class="preprocessor">#define ATLAS_MESSAGE_DECODERBASE_H</span>
<a name="l00007"></a>00007 <span class="preprocessor"></span>
<a name="l00008"></a>00008 <span class="preprocessor">#include &lt;Atlas/Bridge.h&gt;</span>
<a name="l00009"></a>00009 
<a name="l00010"></a>00010 <span class="preprocessor">#include &lt;map&gt;</span>
<a name="l00011"></a>00011 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;stack&gt;</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&lt;std::string, Element&gt; MapType;
<a name="l00020"></a>00020 <span class="keyword">typedef</span> std::vector&lt;Element&gt; ListType;
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 
<a name="l00038"></a><a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html">00038</a> <span class="keyword">class </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> : <span class="keyword">public</span> <a class="code" href="class_atlas_1_1_bridge.html" title="Atlas stream bridge.">Bridge</a>
<a name="l00039"></a>00039 {
<a name="l00040"></a>00040 <span class="keyword">public</span>:
<a name="l00041"></a>00041     <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="l00042"></a>00042 
<a name="l00043"></a>00043     <span class="keyword">virtual</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="l00044"></a>00044 
<a name="l00045"></a>00045     <span class="comment">// Callback functions from Bridge</span>
<a name="l00046"></a>00046     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#f1d7f241afe867d3412f0141b63904f2" title="Begin an Atlas stream.">streamBegin</a>();
<a name="l00047"></a>00047     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#71d2993e472cb449a0237f263d49e9ef" title="Start a message in an Atlas stream.">streamMessage</a>();
<a name="l00048"></a>00048     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#5a5f94b58ac18e7c263267199feb7171" title="Ends the Atlas stream.">streamEnd</a>();
<a name="l00049"></a>00049 
<a name="l00050"></a>00050     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#cd83c2781d460c7706a92775b719cd43" title="Starts a map object to the currently streamed map.">mapMapItem</a>(<span class="keyword">const</span> std::string&amp; name);
<a name="l00051"></a>00051     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#563efa0e01da70e0d5f77b0318daae9f" title="Starts a list object to the currently streamed map.">mapListItem</a>(<span class="keyword">const</span> std::string&amp; name);
<a name="l00052"></a>00052     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#13e9d0c5a134fc66140619f2cbec51fd" title="Adds an integer to the currently streames map.">mapIntItem</a>(<span class="keyword">const</span> std::string&amp; name, <span class="keywordtype">long</span>);
<a name="l00053"></a>00053     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#0376a076852ab8ef00a8e015d66f5a40" title="Adds a float to the currently streamed map.">mapFloatItem</a>(<span class="keyword">const</span> std::string&amp; name, <span class="keywordtype">double</span>);
<a name="l00054"></a>00054     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#0471141e9e1508168021d8b7b10af0ee" title="Adds a string to the currently streamed map.">mapStringItem</a>(<span class="keyword">const</span> std::string&amp; name, <span class="keyword">const</span> std::string&amp;);
<a name="l00055"></a>00055     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#4c9748fabb19f4a30088c731c3769b88" title="Ends the currently streamed map.">mapEnd</a>();
<a name="l00056"></a>00056     
<a name="l00057"></a>00057     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#659d65eae17f402f47cab0f6fbe12494" title="Starts a map object in the currently streamed list.">listMapItem</a>();
<a name="l00058"></a>00058     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#504425697f1e292251c6388665083493" title="Starts a list object in the currently streamed list.">listListItem</a>();
<a name="l00059"></a>00059     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#a088de0dab0af7abc3f202590a6770da" title="Adds an integer to the currently streames list.">listIntItem</a>(<span class="keywordtype">long</span>);
<a name="l00060"></a>00060     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#c03684da91d91f4a2698af75701f9df1" title="Adds a float to the currently streamed list.">listFloatItem</a>(<span class="keywordtype">double</span>);
<a name="l00061"></a>00061     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#9b1030476ae7e1088d1201bdcc0db0cb" title="Adds a string to the currently streamed list.">listStringItem</a>(<span class="keyword">const</span> std::string&amp;);
<a name="l00062"></a>00062     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#dfc757c364b1562a0a650c1051869f29" title="Ends the currently streamed list.">listEnd</a>();
<a name="l00063"></a>00063     
<a name="l00064"></a>00064 <span class="keyword">protected</span>:
<a name="l00065"></a>00065 
<a name="l00067"></a><a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#3c05ee539ce0b3c26818115d4b3bebcb">00067</a>     <span class="keyword">enum</span> <a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#3c05ee539ce0b3c26818115d4b3bebcb" title="Our current decoding state.">State</a> {
<a name="l00068"></a>00068         STATE_STREAM,
<a name="l00069"></a>00069         STATE_MAP,
<a name="l00070"></a>00070         STATE_LIST
<a name="l00071"></a>00071     };
<a name="l00072"></a>00072 
<a name="l00074"></a><a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#9641490ce4411d8ec1f9ef7f78fc77c2">00074</a>     std::stack&lt;State&gt; <a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#9641490ce4411d8ec1f9ef7f78fc77c2" title="The state stack.">m_state</a>;
<a name="l00076"></a><a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#ffb57a15fce40de3bcccc999398347c1">00076</a>     std::stack&lt;MapType&gt; <a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#ffb57a15fce40de3bcccc999398347c1" title="The map stack.">m_maps</a>;
<a name="l00078"></a><a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#8a08e85c2a4cce503aafbd1590249adf">00078</a>     std::stack&lt;ListType&gt; <a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#8a08e85c2a4cce503aafbd1590249adf" title="The list stack.">m_lists</a>;
<a name="l00080"></a><a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#655670d438beceb34bbaa0042fa81947">00080</a>     std::stack&lt;std::string&gt; <a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#655670d438beceb34bbaa0042fa81947" title="Names for maps and lists.">m_names</a>;
<a name="l00081"></a>00081 
<a name="l00083"></a>00083     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_atlas_1_1_message_1_1_decoder_base.html#df02eaea95eb140be685d3d228727de1" title="Override this - called when an object was received.">messageArrived</a>(<span class="keyword">const</span> MapType&amp; obj) = 0;
<a name="l00084"></a>00084 };
<a name="l00085"></a>00085 
<a name="l00086"></a>00086 } } <span class="comment">// namespace Atlas::Message</span>
<a name="l00087"></a>00087 
<a name="l00088"></a>00088 <span class="preprocessor">#endif</span>
</pre></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>