Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
Printable< T, M > Class Template Reference

#include <elm/io/Output.h>

Public Member Functions

 Printable (const T &data, const M &man)
 
const T & data (void) const
 
const M & man (void) const
 

Detailed Description

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;
cout << io::p(v, m) << io::endl;

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
TType of values.
MType of manager.

Constructor & Destructor Documentation

◆ Printable()

Printable ( const T &  data,
const M &  man 
)
inline

Member Function Documentation

◆ data()

const T& data ( void  ) const
inline

◆ man()

const M& man ( void  ) const
inline

The documentation for this class was generated from the following file:
elm::io::p
Printable< T, M > p(const T &data, const M &man)
Definition: Output.h:302
elm::io::out
sys::SystemOutStream & out
Definition: system_SystemIO.cpp:122
elm::cout
io::Output cout
elm::io::endl
const EOL endl
Definition: io_Output.cpp:880