Teuchos - Trilinos Tools Package
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
comm
src
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
21
22
#include "
Teuchos_ConfigDefs.hpp
"
23
#include "
Teuchos_RCP.hpp
"
24
#include "
Teuchos_Array.hpp
"
25
#include <iostream>
26
#include <iomanip>
27
28
namespace
Teuchos
29
{
37
class
TableEntry
38
{
39
public
:
41
TableEntry
() {}
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
125
class
CompoundEntryWithParentheses :
public
TableEntry
126
{
127
public
:
129
CompoundEntryWithParentheses(
const
RCP<TableEntry>
& first,
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
Teuchos_Array.hpp
Templated array class derived from the STL std::vector.
Teuchos_ConfigDefs.hpp
Teuchos header file which uses auto-configuration information to include necessary C++ headers.
Teuchos_RCP.hpp
Reference-counted pointer class and non-member templated function implementations.
Teuchos::CompoundEntryWithParentheses::toString
virtual std::string toString() const
Write the specified entry to a std::string.
Definition
Teuchos_TableEntry.cpp:83
Teuchos::DoubleEntry::toString
virtual std::string toString() const
Write the specified entry to a std::string.
Definition
Teuchos_TableEntry.cpp:30
Teuchos::DoubleEntry::DoubleEntry
DoubleEntry(const double &value, int precision, const std::ios_base::fmtflags &flags)
Construct with a value and a precision.
Definition
Teuchos_TableEntry.cpp:26
Teuchos::IntEntry::toString
virtual std::string toString() const
Write the specified entry to a std::string.
Definition
Teuchos_TableEntry.cpp:46
Teuchos::IntEntry::IntEntry
IntEntry(int value, const std::ios_base::fmtflags &flags)
Construct with a value.
Definition
Teuchos_TableEntry.cpp:42
Teuchos::RCP
Smart reference counting pointer class for automatic garbage collection.
Definition
Teuchos_RCPDecl.hpp:397
Teuchos::StringEntry::StringEntry
StringEntry(std::string value)
Construct with a value.
Definition
Teuchos_TableEntry.cpp:58
Teuchos::StringEntry::toString
virtual std::string toString() const
Write the specified entry to a std::string.
Definition
Teuchos_TableEntry.cpp:62
Teuchos::TableEntry::TableEntry
TableEntry()
Empty ctor.
Definition
Teuchos_TableEntry.hpp:41
Teuchos::TableEntry::~TableEntry
virtual ~TableEntry()
virtual dtor
Definition
Teuchos_TableEntry.hpp:44
Teuchos::TableEntry::toString
virtual std::string toString() const =0
Return a std::string representation of this entry.
Teuchos::TableEntry::toChoppedString
virtual std::string toChoppedString(int maxWidth) const
Return a std::string representation of this entry, truncated if necessary to fit within the given col...
Definition
Teuchos_TableEntry.cpp:17
Teuchos
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
Generated by
1.17.0