ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
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
10namespace ModuleIO
11{
13{
14 public:
16
17 Input_Item(const std::string& label_in)
18 {
19 label = label_in;
20 }
21
23 {
24 label = item.label;
26 final_value.str(item.final_value.str());
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
Definition input_item.h:13
std::function< void(const Input_Item &, Parameter &)> read_value
read value function
Definition input_item.h:53
std::function< void(const Input_Item &, const Parameter &)> check_value
check value function
Definition input_item.h:55
Input_Item(const std::string &label_in)
Definition input_item.h:17
std::vector< std::string > str_values
string values of the input item
Definition input_item.h:35
Input_Item()
Definition input_item.h:15
std::stringstream final_value
final value for writing to output INPUT file
Definition input_item.h:36
Input_Item(const Input_Item &item)
Definition input_item.h:22
std::string label
label of the input item
Definition input_item.h:34
size_t get_size() const
< get size of the input item
Definition input_item.h:43
bool is_read() const
< check if the input item is read
Definition input_item.h:38
std::function< void(const Input_Item &, Parameter &)> reset_value
Definition input_item.h:58
std::function< void(Input_Item &, const Parameter &)> get_final_value
get final_value function for output INPUT file
Definition input_item.h:60
std::string annotation
annotation of the input item
Definition input_item.h:48
Definition parameter.h:13
Parameter param
Definition io_system_variable_test.cpp:38
This class has two functions: restart psi from the previous calculation, and write psi to the disk.
Definition cal_dos.h:9