16#ifndef dealii_table_handler_h
17#define dealii_table_handler_h
25#include <boost/serialization/map.hpp>
26#include <boost/serialization/split_member.hpp>
27#include <boost/serialization/string.hpp>
28#include <boost/serialization/vector.hpp>
29#include <boost/variant.hpp>
98 cache_string(
bool scientific,
unsigned int precision)
const;
121 template <
class Archive>
123 save(Archive &ar,
const unsigned int version)
const;
130 template <
class Archive>
132 load(Archive &ar,
const unsigned int version);
140 template <
class Archive>
142 serialize(Archive &archive,
const unsigned int version);
146 BOOST_SERIALIZATION_SPLIT_MEMBER()
154 boost::variant<int, unsigned int, std::uint64_t, double, std::string>;
166 friend class ::TableHandler;
413 template <
typename T>
415 add_value(
const std::string &key,
const T value);
454 const std::string &superkey);
481 set_precision(
const std::string &key,
const unsigned int precision);
496 set_tex_caption(
const std::string &key,
const std::string &tex_caption);
517 const std::string &tex_supercaption);
526 set_tex_format(
const std::string &key,
const std::string &format =
"c");
551 write_tex(std::ostream &file,
const bool with_header =
true)
const;
573 template <
class Archive>
575 serialize(Archive &ar,
const unsigned int version);
587 <<
"Column <" << arg1 <<
"> does not exist.");
594 <<
"Supercolumn <" << arg1 <<
"> does not exist.");
601 <<
"Column or supercolumn <" << arg1 <<
"> does not exist.");
611 <<
"Column <" << arg1 <<
"> has " << arg2
612 <<
" rows, but Column <" << arg3 <<
"> has " << arg4
620 <<
"<" << arg1 <<
"> is not a tex column format. Use "
621 <<
"'l', 'c', or 'r' to indicate left, centered, or "
622 <<
"right aligned text.");
653 template <
class Archive>
655 save(Archive &ar,
const unsigned int version)
const;
662 template <
class Archive>
664 load(Archive &ar,
const unsigned int version);
672 template <
class Archive>
674 serialize(Archive &archive,
const unsigned int version);
678 BOOST_SERIALIZATION_SPLIT_MEMBER()
772 mutable std::map<std::string, Column>
columns;
811 template <
typename T>
817 template <
typename T>
829 return boost::get<T>(
value);
835 "This TableEntry object does not store a datum of type T"));
842 template <
class Archive>
849 if (
const int *p = boost::get<int>(&
value))
854 else if (
const unsigned int *p = boost::get<unsigned int>(&
value))
859 else if (
const double *p = boost::get<double>(&
value))
864 else if (
const std::string *p = boost::get<std::string>(&
value))
869 else if (
const std::uint64_t *p = boost::get<std::uint64_t>(&
value))
880 template <
class Archive>
953 unsigned int max_col_length = 0;
954 for (
const auto &column :
columns)
957 static_cast<unsigned int>(column.second.entries.size()));
959 while (
columns[key].entries.size() + 1 < max_col_length)
966 static_cast<unsigned int>(
982template <
class Archive>
991template <
class Archive>
995 ar &entries &tex_caption &tex_format &precision &scientific &flag &max_length;
1000template <
class Archive>
void set_tex_format(const std::string &key, const std::string &format="c")
void set_tex_table_caption(const std::string &table_caption)
void set_tex_supercaption(const std::string &superkey, const std::string &tex_supercaption)
void serialize(Archive &ar, const unsigned int version)
void declare_column(const std::string &key)
void write_text(std::ostream &out, const TextOutputFormat format=table_with_headers) const
void set_auto_fill_mode(const bool state)
void add_value(const std::string &key, const T value)
void write_tex(std::ostream &file, const bool with_header=true) const
void add_column_to_supercolumn(const std::string &key, const std::string &superkey)
void set_column_order(const std::vector< std::string > &new_order)
void set_tex_caption(const std::string &key, const std::string &tex_caption)
void set_scientific(const std::string &key, const bool scientific)
void set_tex_table_label(const std::string &table_label)
void set_precision(const std::string &key, const unsigned int precision)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
static ::ExceptionBase & ExcSuperColumnNotExistent(std::string arg1)
static ::ExceptionBase & ExcWrongNumberOfDataEntries(std::string arg1, int arg2, std::string arg3, int arg4)
static ::ExceptionBase & ExcColumnNotExistent(std::string arg1)
#define DeclException4(Exception4, type1, type2, type3, type4, outsequence)
void load(Archive &ar, const unsigned int version)
void save(Archive &ar, const unsigned int version) const
void pad_column_below(const unsigned int length)
void serialize(Archive &archive, const unsigned int version)
void save(Archive &ar, const unsigned int version) const
unsigned int n_rows() const
void get_selected_columns(std::vector< std::string > &sel_columns) const
#define Assert(cond, exc)
std::map< std::string, std::vector< std::string > > supercolumns
@ simple_table_with_separate_column_description
@ table_with_separate_column_description
std::map< std::string, std::string > tex_supercaptions
std::string tex_table_label
static ::ExceptionBase & ExcUndefinedTexFormat(std::string arg1)
std::string tex_table_caption
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcColumnOrSuperColumnNotExistent(std::string arg1)
#define DeclException1(Exception1, type1, outsequence)
void load(Archive &ar, const unsigned int version)
std::vector< std::string > column_order
std::vector< internal::TableEntry > entries
static ::ExceptionBase & ExcMessage(std::string arg1)
std::map< std::string, Column > columns
::VectorizedArray< Number, width > max(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
void serialize(Archive &archive, const unsigned int version)
TableEntry get_default_constructed_copy() const
const std::string & get_cached_string() const
double get_numeric_value() const
void cache_string(bool scientific, unsigned int precision) const
boost::variant< int, unsigned int, std::uint64_t, double, std::string > value_type