ABACUS
develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
source
source_io
input_item.h
Go to the documentation of this file.
1
#ifndef INPUT_ITEM_H
2
#define INPUT_ITEM_H
3
#include <functional>
4
#include <map>
5
#include <sstream>
6
#include <string>
7
#include <vector>
8
9
#include "
source_io/module_parameter/parameter.h
"
10
namespace
ModuleIO
11
{
12
class
Input_Item
13
{
14
public
:
15
Input_Item
(){};
16
17
Input_Item
(
const
std::string& label_in)
18
{
19
label
= label_in;
20
}
21
22
Input_Item
(
const
Input_Item
& item)
23
{
24
label
= item.
label
;
25
str_values
= item.
str_values
;
26
final_value
.str(item.
final_value
.str());
27
annotation
= item.
annotation
;
28
read_value
= item.
read_value
;
29
check_value
= item.
check_value
;
30
reset_value
= item.
reset_value
;
31
get_final_value
= item.
get_final_value
;
32
}
33
34
std::string
label
;
35
std::vector<std::string>
str_values
;
36
std::stringstream
final_value
;
37
38
bool
is_read
() const
39
{
40
return
!
str_values
.empty();
41
}
42
43
size_t
get_size
() const
44
{
45
return
str_values
.size();
46
}
47
48
std::string
annotation
;
49
50
// ====== !!! These functions are complete. ======
51
// ====== !!! Do not add any more functions here. ======
53
std::function<void(
const
Input_Item
&,
Parameter
&)>
read_value
= [](
const
Input_Item
& item,
Parameter
&
param
) {};
55
std::function<void(
const
Input_Item
&,
const
Parameter
&)>
check_value
=
nullptr
;
58
std::function<void(
const
Input_Item
&,
Parameter
&)>
reset_value
=
nullptr
;
60
std::function<void(
Input_Item
&,
const
Parameter
&)>
get_final_value
=
nullptr
;
61
// ====== !!! Do not add any more functions here. ======
62
};
63
64
}
// namespace ModuleIO
65
#endif
// INPUT_ITEM_H
ModuleIO::Input_Item
Definition
input_item.h:13
ModuleIO::Input_Item::read_value
std::function< void(const Input_Item &, Parameter &)> read_value
read value function
Definition
input_item.h:53
ModuleIO::Input_Item::check_value
std::function< void(const Input_Item &, const Parameter &)> check_value
check value function
Definition
input_item.h:55
ModuleIO::Input_Item::Input_Item
Input_Item(const std::string &label_in)
Definition
input_item.h:17
ModuleIO::Input_Item::str_values
std::vector< std::string > str_values
string values of the input item
Definition
input_item.h:35
ModuleIO::Input_Item::Input_Item
Input_Item()
Definition
input_item.h:15
ModuleIO::Input_Item::final_value
std::stringstream final_value
final value for writing to output INPUT file
Definition
input_item.h:36
ModuleIO::Input_Item::Input_Item
Input_Item(const Input_Item &item)
Definition
input_item.h:22
ModuleIO::Input_Item::label
std::string label
label of the input item
Definition
input_item.h:34
ModuleIO::Input_Item::get_size
size_t get_size() const
< get size of the input item
Definition
input_item.h:43
ModuleIO::Input_Item::is_read
bool is_read() const
< check if the input item is read
Definition
input_item.h:38
ModuleIO::Input_Item::reset_value
std::function< void(const Input_Item &, Parameter &)> reset_value
Definition
input_item.h:58
ModuleIO::Input_Item::get_final_value
std::function< void(Input_Item &, const Parameter &)> get_final_value
get final_value function for output INPUT file
Definition
input_item.h:60
ModuleIO::Input_Item::annotation
std::string annotation
annotation of the input item
Definition
input_item.h:48
Parameter
Definition
parameter.h:13
param
Parameter param
Definition
io_system_variable_test.cpp:38
ModuleIO
This class has two functions: restart psi from the previous calculation, and write psi to the disk.
Definition
cal_dos.h:9
parameter.h
Generated by
1.9.8