-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiprintable.hpp
54 lines (47 loc) · 1.66 KB
/
iprintable.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/******************************************************************************
* GRIDGEN: Grid Generating Compiler
* By: Andy Stone (aistone@gmail.com)
* (C) Copyright 2011 Colorado State University
*****************************************************************************/
/** \addtogroup IO
* @{
*/
#ifndef IPRINTABLE_HPP_
#define IPRINTABLE_HPP_
#include <ostream>
/**
* Initialization function for the iprintable module.
*/
void initializeModule_iprintable();
/**
* Printable objects are able to push human readable representations of
* themselves onto a text stream such as the console. There are two
* representations of printable objects: (1) the detailed representation, and
* the (2) simple representation.
*/
class IPrintable {
public:
// =======================
// - [Input and Output] -
// =======================
/** @name Input and Output */
///@{
/**
* Output a detailed representation of this object onto a text stream.
* The detailed representation should properly indent and highlight the
* output using the indt and syntax manipulators in <utils.hpp>.
**/
virtual void print(std::ostream &out) const = 0;
/**
* Output a simplified representation of this object onto a text
* stream.
**/
virtual void printSimp(std::ostream &out) const = 0;
///@}
};
/** Let IPrintable objects be passed to ostreams via <<. */
std::ostream& operator<<(std::ostream& os, const IPrintable& val);
/** Let pointers to IPrintable objects be passed to ostreams via <<. */
std::ostream& operator<<(std::ostream& os, const IPrintable *val);
#endif
/** @}*/