Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
printable.cpp
1 
2 /***************************************************************************
3  * printable.cpp - Printable interface
4  *
5  * Created: Thu Oct 09 10:43:59 2008
6  * Copyright 2008 Daniel Beck
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #include <geometry/printable.h>
25 
26 namespace fawkes {
27 
28 /** @class fawkes::Printable <geometry/printable.h>
29  * Interface class for printable objects. Printable objects can be
30  * printed by means of the <<-operator.
31  *
32  * @author Daniel Beck
33  */
34 
35 /** @fn std::ostream& fawkes::Printable::print(std::ostream& stream) const
36  * This method is called by the overloaded <<-operator.
37  * @param stream the output stream
38  * @return reference to the output stream
39  */
40 
41 /** Constructor. */
43 {
44 }
45 
46 /** Destructor. */
48 {
49 }
50 
51 } // end namespace fawkes
52 
53 /** Overloaded <<-operator that calls the print() method of the given
54  * Printable object.
55  * @param stream the output stream
56  * @param p the Printable object
57  * @return the output stream
58  */
59 std::ostream& operator<<(std::ostream& stream, const fawkes::Printable& p)
60 {
61  return p.print(stream);
62 }
63 
virtual std::ostream & print(std::ostream &stream) const =0
This method is called by the overloaded <<-operator.
Printable()
Constructor.
Definition: printable.cpp:42
virtual ~Printable()
Destructor.
Definition: printable.cpp:47
Interface class for printable objects.
Definition: printable.h:37