Cadabra
Computer algebra system for field theory problems
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  {
18  out_ << obj;
19  return *this;
20  }
21 
22  TerminalStream& operator <<(std::ostream& (*os)(std::ostream&))
23  {
24  out_ << os;
25  return *this;
26  }
27  private:
28  const Kernel& kernel;
29  std::ostream& out_;
30  };
31 
32 
33  }
Basic storage class for symbolic mathemematical expressions.
Definition: Storage.hh:142
Definition: Kernel.hh:15
Definition: TerminalStream.hh:8
TerminalStream & operator<<(const T &obj)
Definition: TerminalStream.hh:16
std::ostream & out_
Definition: TerminalStream.hh:29
TerminalStream(const Kernel &, std::ostream &)
Definition: TerminalStream.cc:7
const Kernel & kernel
Definition: TerminalStream.hh:28
TerminalStream & operator<<(const Ex &)
Definition: TerminalStream.cc:12
Functions to handle the exchange properties of two or more symbols in a product.
Definition: Adjform.cc:83