Boost logo

Boost Users :

Subject: [Boost-users] finite state filters controlled ...
From: raespi (raespi_at_[hidden])
Date: 2014-02-18 16:18:36


Boost hi .. I'm using the finite state filter component in the iostreams
library to create a state machine that can easily help me process
incoming data streams from various medical sensors. I'm currently
working around the following scenarios and wanted to run them by the
list to see if the method I chose was the preferred one.

1- Constant datastream with no variation in datagrams. Solution: use
finite state filters as they come, works ok !
2- Variable datastreams with constant size in datagrams. Solution: use
finite state filters with a transition table that can interpret anything
and choosing in the processing function the right way to go, not very
clean, but works !!
3- Variable datastreams with variable sizes. Solution: trying to change
the finite state filter on the go, currently doesn't work. I noticed
that when bytes are inserted into the state machine these don't get
processed until a certain buffer size is met internally, resulting in a
behaviour where data gets analyzed long after it has been inserted. I
saw that the flush() function for the iostream that contains de state
machine suffices when called before inserting a new character with a
line such as:

io::flush<io::filtering_ostream> ( this->data );

but the problem is that the only mechanism that can determine when a
whole package has been received and one can change state machines to
analyze a new state lies within the state machine itself (in the
processing functions), I can't issue a flush() from within a state
machine since it won't execute until a specific buffer size is met.

Any ideas on how to go around this matter ??

I'm currently using boost 1.53 on Linux

Thanks ...


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