libfactory++ README
===================

libfactory++ is (c) 2004 Martin F. Krafft <krafft@ailab.ch>
and distributed under the terms of the Artistic Licence.
See the file ./COPYING in the source distribution for more information.

Revision: $Id: README,v 1.7 2004/05/31 00:31:24 krafft Exp $

Please send bugreports to <libfactory@pobox.madduck.net>.

Introduction
------------

libfactory++ is a C++ template framework for run-time dynamic type
instantiation. You can register single classes or whole hierarchies, and then
tell libfactory++ to instantiate objects using the registration key. For
instance, if you register class A with key 1 and a child class A::B with key
2, then you could say create(1) to obtain a pointer to a newly allocated and
constructed A object, or create(2) to return an A* containing a new instance
of A::B.

libfactory++ differs from other factory approaches mainly in its flexibility.
For one, libfactory++ can use any constructor a type supports, and allows you
to choose (and configure) the constructor to use for each call to create().
Second, it supports custom allocators, allowing you to use e.g. a memory pool
rather than continuous invocations of 'new'.
 
Notes
-----

Note that the library is not (yet) complete and it's not thoroughly tested.
However, given the effort and grief I went through in writing it, I would
like to make it available to folks, get people to test it, and hopefully have
some peeps submit improvements. If you have any suggestions, please write to
me at krafft@ailab.ch.

It's not yet documented, although the usage should be fairly straight
forward. I am hoping to find someone else to document it as I suck at
documentation and as the author, it's exceptionally difficult to stay
didactically correct.

Credits
-------

While the library was written all by myself, it would not have been possible
without the help of a number of people. Foremost, I would like to thank the
folks from the #c++ channel on Freenode, specifically orbitz, quix, Erwin,
pwned, wcstok, dasOp, Chaku, Adrinael, The_Vulture, and LIM2 (if I left anyone
out, let me know). Furthermore, I would like to thank Stephan Beal, author of
libs11n, for his libclass_loader, which gave me some inspiration. Finally,
I thank the Artificial Intelligence Laboratory of the University of Zurich,
Dr. Peter Eggenberger and Gabriel Gmez for giving me the opportunity to write
this stuff.

I also have to thank the Debian project for providing an amazingly reliable
and flexible developer station with their operating system. I am sorry for 
everyone who has to use something else.

Usage
-----

A simple example program is provided in the ./examples directory
(/usr/share/doc/libfactory++-dev/examples on Debian).

The library supports pkg-config. Thus, to compile with the library,

  #include <factory++/factory++.hpp>

and append the output of `pkg-config libkdtree++ --cflags` to your $CPPFLAGS.

Have fun.
