deal.II version GIT relicensing-2167-g9622207b8f 2024-11-21 12:40:00+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Private Attributes | Friends | List of all members
internal::TableEntry Struct Reference

#include <deal.II/base/table_handler.h>

Public Member Functions

 TableEntry ()=default
 
template<typename T >
 TableEntry (const T &t)
 
template<typename T >
get () const
 
double get_numeric_value () const
 
void cache_string (bool scientific, unsigned int precision) const
 
const std::string & get_cached_string () const
 
TableEntry get_default_constructed_copy () const
 
template<class Archive >
void save (Archive &ar, const unsigned int version) const
 
template<class Archive >
void load (Archive &ar, const unsigned int version)
 
template<class Archive >
void serialize (Archive &archive, const unsigned int version)
 

Private Types

using value_type = std::variant< int, unsigned int, std::uint64_t, double, std::string >
 

Private Attributes

value_type value
 
std::string cached_value
 

Friends

class ::TableHandler
 

Detailed Description

A TableEntry stores the value of a table entry. It can either be of type int, unsigned int, std::uint64_t, double or std::string. In essence, this structure is the same as std::variant<int,unsigned int,std::uint64_t,double,std::string> but we wrap this object in a structure for which we can write a function that can serialize it. This is also why the function is not in fact of type std::any.

Definition at line 53 of file table_handler.h.

Member Typedef Documentation

◆ value_type

using internal::TableEntry::value_type = std::variant<int, unsigned int, std::uint64_t, double, std::string>
private

Abbreviation for the data type stored by this object.

Definition at line 150 of file table_handler.h.

Constructor & Destructor Documentation

◆ TableEntry() [1/2]

internal::TableEntry::TableEntry ( )
default

Default constructor.

◆ TableEntry() [2/2]

template<typename T >
internal::TableEntry::TableEntry ( const T &  t)
explicit

Constructor. Initialize this table element with the value t.

Definition at line 809 of file table_handler.h.

Member Function Documentation

◆ get()

template<typename T >
T internal::TableEntry::get ( ) const

Return the value stored by this object. The template type T must be one of int,unsigned int,std::uint64_t,double,std::string and it must match the data type of the object originally stored in this TableEntry object.

Definition at line 816 of file table_handler.h.

◆ get_numeric_value()

double internal::TableEntry::get_numeric_value ( ) const

Return the numeric value of this object if data has been stored in it either as an integer, an unsigned integer,std::uint64_t, or a double.

Returns
double

Definition at line 34 of file table_handler.cc.

◆ cache_string()

void internal::TableEntry::cache_string ( bool  scientific,
unsigned int  precision 
) const

Cache the contained value with the given formatting and return it. The given parameters from the column definition are used for the formatting. The value is cached as a string internally in cached_value. The cache needs to be invalidated with this routine if the formatting of the column changes.

Definition at line 82 of file table_handler.cc.

◆ get_cached_string()

const std::string & internal::TableEntry::get_cached_string ( ) const

Return the value cached using cache_string(). This is just a wrapper around cached_value.

Definition at line 104 of file table_handler.cc.

◆ get_default_constructed_copy()

TableEntry internal::TableEntry::get_default_constructed_copy ( ) const

Return a TableEntry object that has the same data type of the stored value but with a value that is default constructed for this data type. This is used to pad columns below previously set ones.

Definition at line 110 of file table_handler.cc.

◆ save()

template<class Archive >
void internal::TableEntry::save ( Archive &  ar,
const unsigned int  version 
) const

Write the data of this object to a stream for the purpose of serialization using the BOOST serialization library.

Definition at line 841 of file table_handler.h.

◆ load()

template<class Archive >
void internal::TableEntry::load ( Archive &  ar,
const unsigned int  version 
)

Read the data of this object from a stream for the purpose of serialization using the BOOST serialization library.

Definition at line 884 of file table_handler.h.

◆ serialize()

template<class Archive >
void internal::TableEntry::serialize ( Archive &  archive,
const unsigned int  version 
)

Write and read the data of this object from a stream for the purpose of serialization using the BOOST serialization library.

Friends And Related Symbol Documentation

◆ ::TableHandler

friend class ::TableHandler
friend

Definition at line 163 of file table_handler.h.

Member Data Documentation

◆ value

value_type internal::TableEntry::value
private

Stored value.

Definition at line 156 of file table_handler.h.

◆ cached_value

std::string internal::TableEntry::cached_value
mutableprivate

Cache the current value as a string.

Definition at line 161 of file table_handler.h.


The documentation for this struct was generated from the following files: