- Solved the proliferation of type checks for different DAI_ENUM's in properties.cpp
The most elegant solution would be to adapt boost::any such that it can
stream a held object to an output stream if the object is streamable.
However, this would require surgery in boost::any (see
http://lists.boost.org/MailArchives/boost/msg78317.php for a discussion
of how to do this), which I consider to be an important disadvantage.
Another possible solution would be to replace boost::any by some class
hierarchy and to store properties as pointers to the base property
class, using inheritance based polymorphism to allow different types of
properties. The main disadvantage of this solution is that a lot of
boiler-plate code has to be written.
The current solution is the addition of a printProperties() method to
each class, which outputs its Props to a std::string. This is used by
the identify() method. The main disadvantage of this method is, that it
requires yet another explicit enumeration of all properties in the code,
which makes maintenance yet more costly. However, this solution is
consistent with the approach of using individual Props structures
instead of a PropertySet object.
18 files changed: