IOSS  2.0
Iohb_Layout.h
Go to the documentation of this file.
1 // Copyright(C) 1999-2020 National Technology & Engineering Solutions
2 // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3 // NTESS, the U.S. Government retains certain rights in this software.
4 //
5 // See packages/seacas/LICENSE for details
6 
7 #ifndef IOSS_Iohb_Layout_h
8 #define IOSS_Iohb_Layout_h
9 
10 #include <iostream>
11 #include <sstream>
12 #include <string>
13 #include <vector>
14 
15 namespace Iohb {
16  class Layout
17  {
18  public:
19  Layout(bool show_labels, int precision, std::string separator, int field_width);
20  Layout(const Layout &) = delete;
21  Layout &operator=(const Layout &) = delete;
22 
24 
25  friend std::ostream &operator<<(std::ostream & /*o*/, Layout & /*lo*/);
26 
27  void add_literal(const std::string &label);
28  void add_legend(const std::string &label);
29  void add(const std::string &name, double value);
30  void add(const std::string &name, int value);
31  void add(const std::string &name, long value);
32  void add(const std::string &name, const std::string &value);
33 
34  void add(const std::string &name, std::vector<double> &value);
35  void add(const std::string &name, std::vector<int> &value);
36  void add(const std::string &name, std::vector<long> &value);
37  void add(const std::string &name, std::vector<std::string> &value);
38 
39  private:
40  std::ostringstream layout_{};
41  std::string separator_{};
42 
44  int count_; // Number of fields on current line...
46  bool showLabels;
48  };
49 } // namespace Iohb
50 
51 #endif // IOSS_Iohb_Layout_h
Iohb::Layout::add_literal
void add_literal(const std::string &label)
Definition: Iohb_Layout.C:27
Iohb::Layout::legendStarted
bool legendStarted
Definition: Iohb_Layout.h:47
Iohb::Layout::separator_
std::string separator_
Definition: Iohb_Layout.h:41
Iohb::Layout::precision_
int precision_
Definition: Iohb_Layout.h:43
Iohb::Layout::operator<<
friend std::ostream & operator<<(std::ostream &, Layout &)
Definition: Iohb_Layout.C:21
Iohb::Layout::operator=
Layout & operator=(const Layout &)=delete
Iohb::Layout::add_legend
void add_legend(const std::string &label)
Definition: Iohb_Layout.C:29
Iohb::Layout::fieldWidth_
int fieldWidth_
Definition: Iohb_Layout.h:45
Iohb::Layout::count_
int count_
Definition: Iohb_Layout.h:44
Iohb
A namespace for the heartbeat database format.
Definition: Iohb_DatabaseIO.C:120
Iohb::Layout
Definition: Iohb_Layout.h:17
Iohb::Layout::add
void add(const std::string &name, double value)
Definition: Iohb_Layout.C:46
Iohb::Layout::Layout
Layout(bool show_labels, int precision, std::string separator, int field_width)
Definition: Iohb_Layout.C:13
Iohb::Layout::~Layout
~Layout()
Iohb::Layout::layout_
std::ostringstream layout_
Definition: Iohb_Layout.h:40
anonymous_namespace{io_info.C}::name
std::string name(const Ioss::GroupingEntity *entity)
Definition: io_info.C:65
Iohb::Layout::Layout
Layout(const Layout &)=delete
Iohb::Layout::showLabels
bool showLabels
Definition: Iohb_Layout.h:46