[Echempp-devel] segment factory
Status: Beta
Brought to you by:
berndspeiser
|
From: <ber...@t-...> - 2005-08-28 18:17:52
|
Dear all, I started the implementation of a SegmentFactory, which can generate segments given a string defining the type of the segment. This would be needed for loading segment information from a file. Here is a preliminary status report. I started with the Loki::Factory template of Alexandrescu. Unfortunately, as we can expect, not everything is straightforward, when we apply this to Segments. First of all, the segment classes are templates (D and I are the parameters!). This means that the registration of the segment with the factory and the definition of the ID string must also be templated. I have not yet solved this problem in a fully satisfying way, but I can indeed do registration. A second problem will be that the create member function (which actually generates the new object according to the string ID) in our case needs a parameter (i.e., the istream from which it can get additional information about the object to be built - namely the segment parameters). This is not possible in the Loki::Factory implementation. I'll continue with this. Regards Bernd -- ======================================================================= Bernd Speiser Institut f"ur Organische Chemie Auf der Morgenstelle 18 D-72076 T"ubingen Germany phone: +49-7071-2976205 (office) +49-7071-2976242 (laboratory) fax: +49-7071-295518 e-mail: ber...@un... Internet: http://www.uni-tuebingen.de/speiser ======================================================================= |