stl:map and mirrored data access
<p>I am getting data from a device that returns flow rate (double) and time (double). I want to store them and be able to access the data using both the flow rate to get the time and time to get the flow rate ... </p>

<p>I'm using two stl:map containers to do this ... is there a way to use only one container? </p>

<p>Here is the method to load the data: 
Flow data (sData) is a comma delimited string ("11.2, 22.3, 14.3, 12.4, 13.3")
Data is gathered each 0.25 seconds - so we just increment the time ... </p>

<pre><code>void LiquidTest::Load(string sData)
{
  string sFlow;
  istringstream iss(sData);

  cout &lt;&lt; "Inside LiquidTest::Load()." &lt;&lt; endl;

  double dTime = 0.0;
  double dFlow = 0.0;

  while (getline(iss, sFlow, ','))
  {
    // add the flow/time to the map(s)
    cout &lt;&lt; "Adding flow/time to map. sFlow=" &lt;&lt; sFlow &lt;&lt; ", dTime=" &lt;&lt; dTime &lt;&lt; "." &lt;&lt; endl;

    // Convert my string to a double
    std::stringstream s(sFlow);
    s &gt;&gt; dFlow;

    // add the flow data and time data to the maps. We will then 
    // be able to access the flow by the time key and the time 
    // by the flow key.  Do I need two maps ??? 
    m_mapFlowDataKeyTime.insert(pair&lt;double, double&gt;(dFlow, dTime));
    m_mapTimeKeyFlowData.insert(pair&lt;double, double&gt;(dTime, dFlow));

    // Increment the time
    dTime += 0.25;
  }
}
</code></pre>
