MathTypeLibrary(libmath++)
0.0.3
Main Page
Related Pages
Classes
Files
File List
math++
printer.h
1
// Math Type Library
3
// $Id: printer.h,v 1.5 2002/04/20 06:31:21 cparpart Exp $
4
// (This file contains the expression stream printer specific interface)
5
//
6
// Copyright (c) 2002 by Christian Parpart <cparpart@surakware.net>
7
//
8
// This library is free software; you can redistribute it and/or
9
// modify it under the terms of the GNU Library General Public
10
// License as published by the Free Software Foundation; either
11
// version 2 of the License, or (at your option) any later version.
12
//
13
// This library is distributed in the hope that it will be useful,
14
// but WITHOUT ANY WARRANTY; without even the implied warranty of
15
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
// Library General Public License for more details.
17
//
18
// You should have received a copy of the GNU Library General Public License
19
// along with this library; see the file COPYING.LIB. If not, write to
20
// the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21
// Boston, MA 02111-1307, USA.
23
#ifndef libmath_printer_h
24
#define libmath_printer_h
25
26
#include <math++/visitor.h>
27
28
#include <iosfwd>
29
30
namespace
math {
31
36
template
<
class
T>
37
class
TPrinter
:
public
TNodeVisitor
<T> {
38
private
:
39
std::ostream& FStream;
40
TPrinter
(std::ostream& AOutput);
41
43
void
savePrint(
const
TNode<T>
*ANode,
const
TNode<T>
*AParent);
44
45
virtual
void
visit(
TNumberNode<T>
*);
46
virtual
void
visit(
TSymbolNode<T>
*);
47
virtual
void
visit(
TParamNode<T>
*);
48
49
virtual
void
visit(
TPlusNode<T>
*);
50
virtual
void
visit(
TNegNode<T>
*);
51
52
virtual
void
visit(
TMulNode<T>
*);
53
virtual
void
visit(
TDivNode<T>
*);
54
55
virtual
void
visit(
TPowNode<T>
*);
56
virtual
void
visit(
TSqrtNode<T>
*);
57
58
virtual
void
visit(
TSinNode<T>
*);
59
virtual
void
visit(
TCosNode<T>
*);
60
virtual
void
visit(
TTanNode<T>
*);
61
virtual
void
visit(
TLnNode<T>
*);
62
63
virtual
void
visit(
TFuncNode<T>
*);
64
virtual
void
visit(
TIfNode<T>
*);
65
66
virtual
void
visit(
TEquNode<T>
*);
67
virtual
void
visit(
TUnEquNode<T>
*);
68
virtual
void
visit(
TGreaterNode<T>
*);
69
virtual
void
visit(
TLessNode<T>
*);
70
virtual
void
visit(
TGreaterEquNode<T>
*);
71
virtual
void
visit(
TLessEquNode<T>
*);
72
73
public
:
77
static
void
printOn
(std::ostream& AOutput,
const
TNode<T>
*AExpr);
78
85
static
std::string
print
(
const
TNode<T>
*AExpr);
86
};
87
88
}
// namespace math
89
90
#include <math++/printer.tcc>
91
92
#endif
math::TGreaterNode
Definition:
nodes.h:625
math::TTanNode
Definition:
nodes.h:538
math::TNegNode
Definition:
nodes.h:448
math::TGreaterEquNode
Definition:
nodes.h:643
math::TLessEquNode
Definition:
nodes.h:652
math::TPowNode
Definition:
nodes.h:486
math::TDivNode
Definition:
nodes.h:474
math::TParamNode
Definition:
nodes.h:374
math::TSqrtNode
Definition:
nodes.h:499
math::TNode< T >
math::TMulNode
Definition:
nodes.h:461
math::TEquNode
Definition:
nodes.h:607
math::TPrinter
Definition:
printer.h:37
math::TLessNode
Definition:
nodes.h:634
math::TSymbolNode
Definition:
nodes.h:354
math::TUnEquNode
Definition:
nodes.h:616
math::TCosNode
Definition:
nodes.h:525
math::TLnNode
Definition:
nodes.h:551
math::TPrinter::printOn
static void printOn(std::ostream &AOutput, const TNode< T > *AExpr)
math::TIfNode
Definition:
nodes.h:586
math::TPlusNode
Definition:
nodes.h:435
math::TSinNode
Definition:
nodes.h:512
math::TNodeVisitor
Definition:
nodes.h:46
math::TPrinter::print
static std::string print(const TNode< T > *AExpr)
math::TFuncNode
Definition:
nodes.h:566
math::TNumberNode
Definition:
nodes.h:335
Generated on Thu Dec 19 2013 11:55:31 for MathTypeLibrary(libmath++) by
1.8.5