title: How to parse a message into the DynamicMessage class and then do the iteration through the fields?
body: <p>Here's what I am trying to figure out, their docs don't explain this well enough, at least to me..</p>
  
  <p><strong>Senario:</strong></p>
  
  <p>I have 5 proto files that I generate with protoc for C++. My application needs to receive a message and then be able to iterate through all the fields while accessing their values and names.</p>
  
  <p>What I would like to do is parse a message into the DynamicMessage class and then do the iteration through the fields. This way I don't have to know exactly what message it is and I can handle them all in a single generic way.</p>
  
  <p>I know it's possible to handle the messages by parsing them to their specific type then treating them as their Message base class but for my application that is not desirable. </p>
  
  <p>It looks like what I want to do should be possible via the "--descriptor_set_out" and dynamic message class.</p>
  
  <p><strong>What I've Tried (<em>And Failed With</em>):</strong></p>
  
  <p>I moved the descriptor.proto into the folder with my protos and included it along side my others in the compilation step. I also set the--descriptor_set_out flag to print to a file "my_descriptors.pb.ds"</p>
  
  <p>I have no idea where to proceed from there.</p>
  
  <p><a href="https://developers.google.com/protocol-buffers/docs/techniques#self-description" rel="noreferrer">Here's what i've referenced, although there isn't much...</a>
  Sorry for the long post, and somewhat vague topic naming schema.</p>
  
  <p>Also, incase it wasn't clear, I assume the messages aren't "Unknown." I assume there will still be the requirement of including the respective headers for each proto so my code knows about the 'unknown' message its handling.</p>