RSC
0.17.1
|
A base class that defines utility functions for printing objects to streams. More...
#include <Printable.h>
Public Member Functions | |
virtual | ~Printable () |
virtual std::string | getClassName () const |
Implement this method and return a human-readable class name. More... | |
virtual void | printContents (std::ostream &stream) const |
This method does the actual printing of class debug information and should be overridden in subclasses. More... | |
virtual void | print (std::ostream &stream) const |
Constructs and prints the final debug output. More... | |
A base class that defines utility functions for printing objects to streams.
The default output format is className[contents]
where className
is returned by getClassName and contents is printed by printContents. Moreover, if a pointer is printed, *
is prepended to the name and at 0xXYZ
is appended after the contents with the object's memory location.
In general it should be sufficient to override printContents but if you want to specify the whole output format, overriding print is needed.
It is advisable to always use virtual inheritance with this class to avoid problems with diamond-shaped inheritance later on.
Definition at line 60 of file Printable.h.
|
virtual |
Definition at line 39 of file Printable.cpp.
|
virtual |
Implement this method and return a human-readable class name.
This method should always return the same class name. Its existence is an admission to missing RTTI functionalities in C++.
Definition at line 42 of file Printable.cpp.
References rsc::runtime::typeName().
|
virtual |
Constructs and prints the final debug output.
stream | stream to print on |
Definition at line 50 of file Printable.cpp.
Referenced by rsc::runtime::operator<<().
|
virtual |
This method does the actual printing of class debug information and should be overridden in subclasses.
stream | stream to print on |
Definition at line 46 of file Printable.cpp.