title: c++ boost::serialization setting a fixed class_id for a class
body: <p>I'mm using boost to serialize and deserialize some classes </p>
  
  <p>Like so:</p>
  
  <pre><code>boost::archive::xml_oarchive xmlArchive(oStringStream);
  
  xmlArchive.register_type(static_cast&lt;BaseMessage *&gt;(NULL));
  xmlArchive.register_type(static_cast&lt;IncomingTradeMessage *&gt;(NULL));
  xmlArchive.register_type(static_cast&lt;InternalRequestInfo *&gt;(NULL));
  xmlArchive.register_type(static_cast&lt;InternalTradeTransInfo *&gt;(NULL));
  
  const BaseMessage* myMessage =message;
  
  xmlArchive &lt;&lt; make_nvp("Message", myMessage);
  </code></pre>
  
  <p>now my clasess get a class_id according to the order used, i dont want that, i want to control the Class_id's</p>
  
  <p>so i can do something like</p>
  
  <pre><code>BOOST_SET_CLASS_ID(1234, BaseMessage);
  </code></pre>
  
  <p>and everywhere in my project BaseMessage would have class_id of 1234.</p>
  
  <p>How can i do such a thing</p>