This chapter describes a set of unary predicates acting on Composite instances, that can be used to identify the class type of a composite at runtime.

This predicates are functionally similar to the RTTI:isKindOf function. They decide whether a given composite is an instance of a certain class (or of a class derived thereof). For instance, the application of a MoleculePredicate to a composite will yield true, if the given composite was an instance of Molecule (or Protein , as Protein is derived from Molecule). Otherwise false is returned.

The two operators are functionally identical (two methods are needed, because the class is derived from TUnaryPredicate and we want to make sure both methods are overwritten). operator() returns true, if the given composite is a kind of the class corresponding to the respective predicate, false otherwise.

Logging, filtering, and storing messages. Many programs emit warning messages, error messages, or simply informations and remarks to their users. The LogStream class provides a convenient and straight-forward interface to classify these messages according to their importance (via the loglevel), filter and store them in files or write them to streams.

As the LogStream class is derived from ostream, it behaves as any ostream object. Additionally you may associate streams with each LogStream object that catch only messages of certain loglevels. So the user might decide to redirect all error messages to cerr, all warning messages to cout and all informations to a file.

Along with each message its time of creation and its loglevel is stored. So the user might also decide to store all errors he got in the last two hours or alike.

The LogStream class heavily relies on the LogStreamBuf class, which does the actual buffering and storing, but is only of interest if you want to implement a derived class, as the actual user interface is implemented in the LogStream class.