
On Wed, Feb 20, 2013 at 3:27 PM, Richard
Boost.Spirit.Qi to parse the stream into data structures Boost.Spirit.Karma to emit the necessary output from the data structures
Richard,
Thank you. I am unfamiliar with Spirit and Karma. Your comment not
only introduced me to them but highlighted just how vague my question
was. I was thinking less about the actual decoding (who would have
known based on what I wrote) and more on how I would "generically" and
"extensibly" handle the many fields I am about to receive.
For example, consider the following horrible code. Is there a "boost"
way to do this kind of thing... (perhaps Spirit/Karma is the answer
and I am just more out of touch than I imagine):
Good things about the classes below:
It is easy to add a new parameter. Just push one onto the back of
EmployeePacket::Items
The class EmployeePacket doesn't have hundreds of data members such as
"string name_, int age_"
Bad things about the classes below:
Extracting data from the EmployeePacket requires hideous dynamic_casts
and hard-coded vector indices
Thank you again for your comments/criticisms/suggestions,
Chris
===
class EmployeePacket
{
std::vector