title: Codesynthesis - Compare string value with sequence in C++
body: <p>I'm new to Codesynthesis and i'm wondering about how i can compare string values with a sequence.</p>
  
  <p>For example i have a Message id "0x100" and i want to check if its in the Send sequences. If its there, i just want to get the Signal name of the Message with the id "0x100" (in this case: "one") and not the whole sequence.</p>
  
  <p>With my code i can get all the Message ids in all Send sequences, but i dont know how to use them to compare it to a string variable respectively just get one element out of the sequence and save it to a string variable.</p>
  
  <p>How can i accomplish this?</p>
  
  <p>Thanks for your help!</p>
  
  <p>This is the xml:</p>
  
  <pre><code>&lt;record&gt;
    &lt;signals&gt;
      &lt;Send name="Port1"&gt;
          &lt;Message id="0x100"&gt;
              &lt;Signal name="one"/&gt;
          &lt;/Message&gt;
          &lt;Message id="0x101"&gt;
              &lt;Signal name="two"/&gt;
              &lt;Signal name="three"/&gt;
              &lt;Signal name="four"/&gt;
          &lt;/Message&gt;
          &lt;Message id="0x102"&gt;
              &lt;Signal name="five"/&gt;
          &lt;/Message&gt;
          &lt;Message id="0x103"&gt;
              &lt;Signal name="six"/&gt;
          &lt;/Message&gt;
          &lt;Message id="0x104"&gt;
              &lt;Signal name="seven"/&gt;
              &lt;Signal name="eight"/&gt;
              &lt;Signal name="nine"/&gt;
              &lt;Signal name="ten"/&gt;
          &lt;/Message&gt;
          &lt;Message id="0x105"&gt;
              &lt;Signal name="eleven"/&gt;
          &lt;/Message&gt;
      &lt;/Send&gt;
      &lt;Send name="Port2"&gt;
          &lt;Message id="0x106"&gt;
              &lt;Signal name="twelve"/&gt;
          &lt;/Message&gt;
          &lt;Message id="0x107"&gt;
              &lt;Signal name="thirteen"/&gt;
          &lt;/Message&gt;
          &lt;Message id="0x108"&gt;
              &lt;Signal name="fourteen"/&gt;
          &lt;/Message&gt;
          &lt;Message id="0x109"&gt;
              &lt;Signal name="fifteen"/&gt;
          &lt;/Message&gt;
          &lt;Message id="0x110"&gt;
              &lt;Signal name="sixteen"/&gt;
          &lt;/Message&gt;
      &lt;/Send&gt;
    &lt;/signals&gt;
  &lt;/record&gt;
  </code></pre>
  
  <p>This is how i read the sequences from the xml:</p>
  
  <pre><code>string filename = "test.xml";
  unique_ptr&lt;record&gt; h(record(filename));
  
  signals::Send_sequence&amp; s(h-&gt;signals().Send());
  for (signals::Send_iterator i(s.begin()); i != s.end(); ++i)
  {
          Send::Message_sequence&amp; s2(i-&gt;Message());
          for (Send::Message_iterator j(s2.begin()); j != s2.end(); ++j)
          {
              Message&amp; u(*j);
              cout &lt;&lt; u.id() &lt;&lt; endl;
          }
  
  }
  </code></pre>