Flow123d  JS_before_hm-1880-gdd969e4e2
Public Member Functions | List of all members
Input::StorageBase Class Referenceabstract

Base class for nodes of a data storage tree. More...

#include <storage.hh>

Inheritance diagram for Input::StorageBase:
Inheritance graph
[legend]

Public Member Functions

virtual std::int64_t get_int () const
 
virtual double get_double () const
 
virtual bool get_bool () const
 
virtual const std::string & get_string () const
 
virtual void set_item (unsigned int index, StorageBase *item)
 
virtual StorageBaseget_item (const unsigned int index) const
 
virtual bool is_null () const =0
 
virtual unsigned int get_array_size () const
 
virtual StorageBasedeep_copy () const =0
 
virtual void print (std::ostream &stream, int pad=0) const =0
 
virtual ~StorageBase ()
 

Detailed Description

Base class for nodes of a data storage tree.

This class as well as its descendants is meant for internal usage only as part of the implementation of the input interface.

The leave nodes of the data storage tree can be of types StorageBool, StorageInt, StorageDouble, and StorageNull. The branching nodes of the tree are of type StorageArray. The data storage tree serves to store data with structure described by Input::Type classes. Therefore it provides no way to ask for the type of stored data and an exception ExcStorageTypeMismatch is thrown if you use getter that do not match actual type of the node. Moreover, the tree can be only created using bottom-up approach and than can not be modified ( this can change if we want to use same storage for buffered reading of large data). However, we provide a method for deep copy of any subtree.

Definition at line 68 of file storage.hh.

Constructor & Destructor Documentation

◆ ~StorageBase()

Input::StorageBase::~StorageBase ( )
virtual

Definition at line 84 of file storage.cc.

Member Function Documentation

◆ deep_copy()

virtual StorageBase* Input::StorageBase::deep_copy ( ) const
pure virtual

Implemented in Input::StorageNull, Input::StorageString, Input::StorageDouble, Input::StorageInt, Input::StorageBool, and Input::StorageArray.

Here is the caller graph for this function:

◆ get_array_size()

unsigned int Input::StorageBase::get_array_size ( ) const
virtual

Reimplemented in Input::StorageArray.

Definition at line 79 of file storage.cc.

Here is the caller graph for this function:

◆ get_bool()

bool Input::StorageBase::get_bool ( ) const
virtual

Reimplemented in Input::StorageBool.

Definition at line 43 of file storage.cc.

Here is the caller graph for this function:

◆ get_double()

double Input::StorageBase::get_double ( ) const
virtual

Reimplemented in Input::StorageDouble.

Definition at line 36 of file storage.cc.

Here is the caller graph for this function:

◆ get_int()

std::int64_t Input::StorageBase::get_int ( ) const
virtual

Reimplemented in Input::StorageInt.

Definition at line 29 of file storage.cc.

Here is the caller graph for this function:

◆ get_item()

StorageBase * Input::StorageBase::get_item ( const unsigned int  index) const
virtual

Reimplemented in Input::StorageArray.

Definition at line 66 of file storage.cc.

Here is the caller graph for this function:

◆ get_string()

const std::string & Input::StorageBase::get_string ( ) const
virtual

Reimplemented in Input::StorageString.

Definition at line 50 of file storage.cc.

Here is the caller graph for this function:

◆ is_null()

bool Input::StorageBase::is_null ( ) const
pure virtual

Implemented in Input::StorageNull, Input::StorageString, Input::StorageDouble, Input::StorageInt, Input::StorageBool, and Input::StorageArray.

Definition at line 73 of file storage.cc.

Here is the caller graph for this function:

◆ print()

virtual void Input::StorageBase::print ( std::ostream &  stream,
int  pad = 0 
) const
pure virtual

Implemented in Input::StorageNull, Input::StorageString, Input::StorageDouble, Input::StorageInt, Input::StorageBool, and Input::StorageArray.

Here is the caller graph for this function:

◆ set_item()

void Input::StorageBase::set_item ( unsigned int  index,
StorageBase item 
)
virtual

Reimplemented in Input::StorageArray.

Definition at line 60 of file storage.cc.

Here is the caller graph for this function:

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