clingo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
printable.hh
Go to the documentation of this file.
1 // {{{ GPL License
2 
3 // This file is part of gringo - a grounder for logic programs.
4 // Copyright (C) 2013 Roland Kaminski
5 
6 // This program is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
10 
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 
16 // You should have received a copy of the GNU General Public License
17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 // }}}
20 
21 #ifndef _GRINGO_PRINTABLE_HH
22 #define _GRINGO_PRINTABLE_HH
23 
24 #include <ostream>
25 
26 namespace Gringo {
27 
28 // {{{ defintion of Printable
29 
30 class Printable {
31 public:
32  virtual void print(std::ostream &out) const = 0;
33  virtual ~Printable() { }
34 };
35 
36 inline std::ostream &operator<<(std::ostream &out, Printable const &x) {
37  x.print(out);
38  return out;
39 }
40 
41 // }}}
42 
43 } // namespace Gringo
44 
45 #endif // _GRINGO_PRINTABLE_HH
46 
Definition: printable.hh:30
virtual void print(std::ostream &out) const =0
std::ostream & operator<<(std::ostream &out, NAF naf)
Definition: base.hh:97
int x
Definition: utility.cc:65
virtual ~Printable()
Definition: printable.hh:33
LparseOutputter & out
Definition: output.cc:685