|
Boost Users : |
From: frederic.bron_at_[hidden]
Date: 2008-01-09 02:37:29
ok, I have seen this now, thanks. However, I must create a derived class from dual_use_filter and those no-op operation are not virtual and it is good practice not to redefine non-virtual member
functions.
So what's happening whenever I use a pointer or reference to a base class? Maybe this never happens because chain.push takes a template parameter... am I right?
Regards,
F. Bron
boost-users-bounces_at_[hidden] a écrit sur 08/01/2008 22: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 mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
Avis :
Ce message et toute pièce jointe sont la propriété d'Alcan et sont destinés seulement aux personnes ou à l'entité à qui le message est adressé. Si vous avez reçu ce message par erreur, veuillez le
détruire et en aviser l'expéditeur par courriel. Si vous n'êtes pas le destinataire du message, vous n'êtes pas autorisé à utiliser, à copier ou à divulguer le contenu du message ou ses pièces jointes
en tout ou en partie.
Notice:
This message and any attachments are the property of Alcan and are intended solely for the named recipients or entity to whom this message is addressed. If you have received this message in error
please inform the sender via e-mail and destroy the message. If you are not the intended recipient you are not allowed to use, copy or disclose the contents or attachments in whole or in part.
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