Boost logo

Boost Users :

Subject: Re: [Boost-users] Can boost help me organize/parse lots of binary data?
From: Chris Stankevitz (chrisstankevitz_at_[hidden])
Date: 2013-02-21 13:53:48


On Thu, Feb 21, 2013 at 9:04 AM, Larry Evans <cppljevans_at_[hidden]> wrote:
> How do you decide whether the Stream argument to Decode contains a
> String or a Double? Is that already known? IOW, if you open the
> istream, do you *know* what types it contains already and only need
> to fill in the values?

Thank you all for your interest and help. I LOVE boost and have been
using it for almost a year now. I cannot live without signals2,
thread, and shared_ptr. They have changed the way I. I am eager to
learn about the other components.

I created a simple program that basically does what I want to do. Of
course in my real application the objects are more complicated and
this is just one small piece of everything I need to do.

What I hope to highlight with this sample cpp is:

1. I am decoding data. The format is about as simple and "fixed" as
you can imagine.

2. The data is not "POD-encoded" values. Sometimes I have to perform
conversions on the values. For example "temperature" in the example.

3. I would like to keep track of some static known-at-compile-time
meta-data for each of the values such as the units they are in. This
I use for display purposes.

4. Some values have meta data that other values do not, such as
floating point values which have a "number of significant digits after
the decimal point" which I illustrate with the "temperature" example.

5. I will have many values. ~60. In my example I attempt to
highlight what a mess the class will turn into if I make no attempt to
use boost::variant, boost::any, polymorphism, etc.

6. An external class "TCTimer" in my example will want access to
Get/Set values in the class.

7. I appear to be confusing/merging several concepts: 1) decoding 2)
tracking meta data for members 3)
replace-lots-of-members-and-with-a-vector-of-something-like-boost::variant

Again, thank you,

Chris




Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net