Boost logo

Boost Users :

Subject: Re: [Boost-users] Sequence of boost::logic::tribools - let indeterminate entries inherit from their neighbours
From: Jens Müller (blog_at_[hidden])
Date: 2014-05-08 08:38:42


Am 08.05.2014 14:17, schrieb Nat Goodspeed:
> On May 8, 2014, at 6:43 AM, Jens Müller<blog_at_[hidden]> wrote:
>
>> >My current idea is actually a sort of proxy output iterator which keeps a counter of "pending" indeterminate tribools and flushes them to the proxied output iterator once their status becomes known. It should also automatically flush in it's destructor.
>> >
>> >Then I could just use std::copy with a std::back_inserter in order to convert a sequence including indeterminate values into a sequence just containing bools.
>> >
>> >Useful?
> Whether it's generally useful depends on the kinds of use cases it addresses. It's an intriguing idea, but I haven't yet imagined an application in which I'd want that. Sorry, limited imagination... please suggest a few?

My use case is a direction filter in a route-time diagram.

The directions can be "along the filter direction", "against the filter
direction" or "no direction" (because the line segment is parallel to
the time axis, i.e., it represents a stopping object).

I want undirected line segments to be visible if they are next to a
visible directed line segment.

So after matching the line segments against the direction filter, their
visibily is true, false or indeterminate.

After applying the inheritance transformation, visibility is either true
or false, with undirected line segments (stops) having the correct
visibility.

BR, Jens


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