Boost logo

Boost :

From: Marco Costalba (mcostalba_at_[hidden])
Date: 2007-09-29 02:29:52


I have finished converting this dynamic object factory to use boost:::fusion

With "dynamic object factory" I mean that new classes could be
registered/unregistered at runtime. This is somewhat different from
other factory library that requires the classes known to the factory,
i.e. the classes for whom the factory creates objects, to be listed at
the point of factory instantation.

In case program is scattered among different library/modules this
could became an important constrain because there is no one point in
the program where you know what will be the all and only classes your
factory will be tailored on.

The feature list is:

           - Support for many class hierarchies at the same time

           - Generic constructor argument type or default c'tor

           - Type safe constructor overloading

           - Support for user supplied 'object create' functions

           - Dynamic class registering/unregistering

           - And finally the most important: 100% type safe also at runtime!

Constructor arguments overloading is a nicety I didn't find in other
implementations.

This is my first attempt with boost::fusion, I hope my understanding
of this library is correct, but of course any feedback on how to
improve the code or the design is very much welcomed.

Library has been uploaded to Vault, file is 'simple_factory.tar.gz'
under base directory.

Library contains a show case program "main.cpp" heavily commented to
be used as a kind of user manual.

Thanks
Marco


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk