Boost logo

Boost Users :

From: Kurt Schwehr (schwehr_at_[hidden])
Date: 2007-04-15 10:39:09


Hi All,

I am new to boost and haven't done much c++ programming in the last
couple years, so apologies if this question is obvious. I'm looking
at dynamic_bitset to build a translator between the bits and NMEA
string packaging for Maritime AIS. Basically this is each character
in a string represents 6 bits of data. I'd like to make two lookup
tables that let me go back and forth quickly between bitsets and the
NMEA ASCII. My dynamic_bitset questions are:

* how can I best concatenate multiple dynamic_bitsets? For example:
lookupbits['a']+lookupbits['1']+lookupbits['g'] would return a
dynamic_bitset of 18 bits. I'm looking for some sort of join
operation and append does not seem to do what I want.

* How can I best slice the results? If I know that, for example, and
unsigned integer is at bits 11-14, is there way to do quickly get a
dynamic_bitset of those bits?

I've got all this working in pure python, but it is way to slow
( http://vislab-ccom.unh.edu/~schwehr/software/noaadata/ in the ais
package). Any suggestions would be greatly appreciated.

Thanks!
-kurt
http://schwehr.org


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