OwnStream.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2009 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/Util/units/OwnStream.h
10 
11 #ifndef __OwnStream_h
12 #define __OwnStream_h
13 
14 #include "Reference.h"
15 #include <ostream>
16 
18 
22 class OwnStream : public Reference::Able
23 {
24  public:
25 
27  OwnStream ();
28 
30  OwnStream (const OwnStream&);
31 
33  const OwnStream& operator = (const OwnStream&);
34 
36  virtual void set_cout (std::ostream&) const;
37 
39  virtual void set_cerr (std::ostream&) const;
40 
41  protected:
42 
43  mutable std::ostream cout;
44  mutable std::ostream cerr;
45 };
46 
47 #endif
const OwnStream & operator=(const OwnStream &)
Assignment operator.
Definition: OwnStream.C:24
virtual void set_cout(std::ostream &) const
Set cout.
Definition: OwnStream.C:29
OwnStream()
Default constructor.
Definition: OwnStream.C:12
Manages Reference::To references to the instance.
Definition: ReferenceAble.h:40
Redefines cerr and cout as attributes of the class.
Definition: OwnStream.h:22
virtual void set_cerr(std::ostream &) const
Set cerr.
Definition: OwnStream.C:34

Generated using doxygen 1.8.17