Boost Users :
Subject: Re: [Boost-users] Factory pattern ?
From: Olivier Tournaire (olitour_at_[hidden])
Date: 2008-10-21 02:43:04
I have a set of classes, each of them being a subclass of a base class. I
need an array of subclasses, and I know which one to instantiate thanks to a
numeric or litteral ID. So, I think the solution which fits my needs is
Tobias Schwinger's Boost.Functional/Factory library.
Thanks for all y our quick answers.
2008/10/21 Stjepan Rajko <stipe_at_[hidden]>
> On Mon, Oct 20, 2008 at 2:32 PM, Olivier Tournaire <olitour_at_[hidden]>
> > Hi all,
> > I am wondering if a factory exists in boost. Any answer ?
> Tobias Schwinger's Boost.Functional/Factory library was accepted into
> boost last year
> (http://lists.boost.org/boost-announce/2007/12/0161.php), but I don't
> think it has made it to trunk yet (I think you can get it from the
> vault). This library provides functional object adapters for both
> dynamic allocation of objects as well as value-based construction.
> I have found it relatively straightforward to use this library in
> concert with Boost.Function and Boost.Bind to construct simple factory
> classes that can allocate objects based on provided keys. If that's
> the sort of factory you are looking for, I recommend Tobias's library.
> Kind regards,
> Boost-users mailing list
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