UnCoVer (Using Coverability for Verification)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Streamable.h
1 /***************************************************************************
2  * Copyright (C) 2014 by Jan Stückrath <jan.stueckrath@uni-due.de> *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU General Public License as published by *
6  * the Free Software Foundation; either version 2 of the License, or *
7  * (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License *
15  * along with this program; if not, write to the *
16  * Free Software Foundation, Inc., *
17  * 51 Franklin St, Fifth Floor, Boston, MA 02110, USA *
18  ***************************************************************************/
19 
20 #ifndef STREAMABLE_H_
21 #define STREAMABLE_H_
22 
23 namespace uncover {
24  namespace basic_types {
25 
31  class Streamable {
32 
33  public:
34 
39  virtual void streamTo(std::ostream& ost) const = 0;
40 
41  protected:
42 
48 
52  virtual ~Streamable() {}
53 
60  friend std::ostream& operator<< (std::ostream& ost, uncover::basic_types::Streamable const& data) {
61  data.streamTo(ost);
62  return ost;
63  }
64 
65  };
66 
67  }
68 }
69 
70 #endif /* STREAMABLE_H_ */
virtual ~Streamable()
Destroys this Streamable object.
Definition: Streamable.h:52
Streamable provides a streaming function which must be implemented by any deriving class...
Definition: Streamable.h:31
virtual void streamTo(std::ostream &ost) const =0
Streams as string representation of this Streamable object to the given ostream.
friend std::ostream & operator<<(std::ostream &ost, uncover::basic_types::Streamable const &data)
Prints a string representation of this Streamable object to the given stream.
Definition: Streamable.h:60
Streamable()
Creates a new Streamable object.
Definition: Streamable.h:47