|
LBANN
0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
|
Generates nicely formatted description messages. More...
#include <description.hpp>
Public Member Functions | |
| description (std::string title="") | |
| void | set_title (std::string title) |
| void | add (std::string line) |
| template<typename T > | |
| void | add (std::string field, T value) |
| void | add (const description &desc) |
Private Attributes | |
| std::string | m_title |
| std::vector< std::string > | m_lines |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const description &desc) |
Generates nicely formatted description messages.
Messages have hanging indentation and can be output to an output stream like std::cout. For example:
Title Some numerical field: 12.3 A boolean parameter: true Miscellaneous statement
Definition at line 49 of file description.hpp.
| lbann::description::description | ( | std::string | title = "" | ) |
| title | First line in description message. |
| void lbann::description::add | ( | std::string | line | ) |
Add new line.
|
inline |
Add new line describing a field value.
The line is formatted:
<field>: <value>
Definition at line 72 of file description.hpp.
| void lbann::description::add | ( | const description & | desc | ) |
Insert a nested description.
The indentation in desc is combined with the current indentation. For instance:
Outer description
Some numerical field: 12.3
Nested description
This: abc
That: 123
| void lbann::description::set_title | ( | std::string | title | ) |
Set first line in description message.
|
friend |
Print description to stream.
|
private |
Lines in message (excluding first line).
When printed, each line is indented.
Definition at line 106 of file description.hpp.
|
private |
First line of message.
When printed, this line isn't indented.
Definition at line 100 of file description.hpp.