Teuchos - Trilinos Tools Package Version of the Day
Loading...
Searching...
No Matches
Teuchos_TableEntry.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Teuchos: Common Tools Package
4//
5// Copyright 2004 NTESS and the Teuchos contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef TEUCHOS_TABLEENTRY_H
11#define TEUCHOS_TABLEENTRY_H
12
23#include "Teuchos_RCP.hpp"
24#include "Teuchos_Array.hpp"
25#include <iostream>
26#include <iomanip>
27
28namespace Teuchos
29{
38 {
39 public:
42
44 virtual ~TableEntry() {}
45
47 virtual std::string toString() const = 0 ;
48
56 virtual std::string toChoppedString(int maxWidth) const ;
57
58 protected:
59 };
60
61
65 class DoubleEntry : public TableEntry
66 {
67 public:
70 DoubleEntry(const double& value, int precision, const std::ios_base::fmtflags& flags);
71
73 virtual std::string toString() const ;
74
75 private:
76 double data_;
77 int precision_;
78 std::ios_base::fmtflags fmtflags_;
79 };
80
81
85 class IntEntry : public TableEntry
86 {
87 public:
89 IntEntry(int value, const std::ios_base::fmtflags& flags);
90
92 virtual std::string toString() const ;
93
94 private:
95 int data_;
96 std::ios_base::fmtflags fmtflags_;
97 };
98
99
103 class StringEntry : public TableEntry
104 {
105 public:
107 StringEntry(std::string value);
108
110 virtual std::string toString() const ;
111
112 private:
113 std::string data_;
114 };
115
126 {
127 public:
130 const RCP<TableEntry>& second,
131 bool spaceBeforeParens=true);
132
134 virtual std::string toString() const ;
135
136 private:
137 RCP<TableEntry> first_;
138 RCP<TableEntry> second_;
139 bool spaceBeforeParens_;
140 };
141
142
143
144
145
146}
147#endif
Templated array class derived from the STL std::vector.
Teuchos header file which uses auto-configuration information to include necessary C++ headers.
Reference-counted pointer class and non-member templated function implementations.
An entry containing two subentries, with the second to be written in parentheses after the first....
virtual std::string toString() const
Write the specified entry to a std::string.
A table entry that is a simple double-precision number.
virtual std::string toString() const
Write the specified entry to a std::string.
A table entry that is a simple integer.
virtual std::string toString() const
Write the specified entry to a std::string.
Smart reference counting pointer class for automatic garbage collection.
A table entry that is a simple std::string.
virtual std::string toString() const
Write the specified entry to a std::string.
An entry, perhaps compound, to be written into a table.
virtual ~TableEntry()
virtual dtor
virtual std::string toString() const =0
Return a std::string representation of this entry.
virtual std::string toChoppedString(int maxWidth) const
Return a std::string representation of this entry, truncated if necessary to fit within the given col...
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...