Cadabra
Computer algebra system for field theory problems
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TerminalStream.hh
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Kernel.hh"
4 #include <ostream>
5 
6 namespace cadabra {
7 
8  class TerminalStream {
9  public:
10  TerminalStream(const Kernel&, std::ostream&);
11 
12  TerminalStream& operator<<(const Ex&);
13  TerminalStream& operator<<(std::shared_ptr<Ex>);
14 
15  template<class T>
16  TerminalStream& operator<<(const T& obj) {
17  out_ << obj;
18  return *this;
19  }
20 
21  TerminalStream& operator <<(std::ostream& (*os)(std::ostream&)) {
22  out_ << os;
23  return *this;
24  }
25  private:
26  const Kernel& kernel;
27  std::ostream& out_;
28  };
29 
30 
31 }
std::ostream & out_
Definition: TerminalStream.hh:27
Basic storage class for symbolic mathemematical expressions.
Definition: Storage.hh:130
const Kernel & kernel
Definition: TerminalStream.hh:26
TerminalStream & operator<<(const Ex &)
Definition: TerminalStream.cc:12
TerminalStream & operator<<(const T &obj)
Definition: TerminalStream.hh:16
Definition: Kernel.hh:15
TerminalStream(const Kernel &, std::ostream &)
Definition: TerminalStream.cc:7
Definition: TerminalStream.hh:8