|
Boost Users : |
From: Jonathan Turkanis (turkanis_at_[hidden])
Date: 2008-01-08 16:12:21
frederic.bron_at_[hidden] wrote:
>
>
> I want to write a filter but this filter needs to do some things when the stream is ending.
> Is it enough to do the following? I want the close function to be called at the end of the stream.
> Do I need to category_flag to inherit from (closable_tag)?
>
> class my_filter : public io::dual_use_filter {
> public:
> template<typename Source> int get(Source&) ;
> template<typename Sink> bool put(Sink&, int) ;
> template<typename Device> void close(Device&, std::ios_base::openmode) ;
> } ;
Hi Fred,
Eric is correct: the convenience base class dual_use_filter has category
convertible to closable_tag, and a no-op implementation of close.
-- Jonathan Turkanis CodeRage http://www.coderage.com
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