template<class T, class M>
class elm::io::Printable< T, M >
This class is used to make easier the display of values controlled by a manager. This concerns values that are not self-contained to be displayed (usually because of memory place issues). The print() function is delegated to a manager object that needs to be referenced in the display of the value. This class embeds together the value and the manager to involve them in operator << display. The best usage of this class is the function elm::io::p() that avoids to manage all the type stuff as below:
class Value {
...
};
class Manager {
...
void print(
const Value& val, io::Output&
out);
...
};
...
Manager m;
Value v;
Notice that the manager class has to provide a print() function taking the value as first parameter and the output stream as second parameter.
- Parameters
-
T | Type of values. |
M | Type of manager. |