79 using DataType = std::map<std::string, std::shared_ptr<Node>>;
80 std::shared_ptr<DataType>
_data;
134 kids_int*
def_int(
const std::string& key,
const std::string& key_in,
const std::string& info =
"");
171 kids_real*
def_real(
const std::string& key,
const std::string& key_in,
const std::string& info =
"");
226 DataSet&
_def(
const std::string& key,
const std::string& key_in,
const std::string& info =
"");
240 std::tuple<kids_dtype, void*, Shape*>
obtain(
const std::string& key);
261 virtual std::string
help(
const std::string& name);
267 virtual std::string
repr();
273 virtual void dump(std::ostream& os);
279 virtual void load(std::istream& is);
290 template <
typename T>
291 T*
def(
const std::string& key,
Shape S = 1,
const std::string& info =
"");
297 size_t start = 0, end;
298 while ((end = key.find(delimiter, start)) != std::string::npos) {
299 terms.emplace_back(key, start, end - start);
300 start = end + delimiter.length();
302 terms.emplace_back(key, start);
provide Exception structs
Declaration of the Node class used for DataSet.
Declaration of the Shape class.
A class inherited from Node, representing tensors.
definition of types in the project and some utiles for types
this file provide Variable class
DataSetKeyParser(const std::string &key, const std::string &delimiter=".")
std::vector< std::string > terms
DataSet class is a tree-structured container for storage of Tensor and other DataSet.
DataSet & _def_complex(const std::string &key, Shape S=1, const std::string &info="")
Define a complex variable with a specified key, shape, and info and update the dataset.
std::map< std::string, std::shared_ptr< Node > > DataType
DataSet & _def_real(const std::string &key, Shape S=1, const std::string &info="")
Define a real variable with a specified key, shape, and info and update the dataset.
virtual void dump(std::ostream &os)
Dump the DataSet to an output stream.
DataSet * at(const std::string &key)
Access the DataSet corresponding to a variable with a specified key.
virtual std::string repr()
Get a string representation of the DataSet.
DataSet & _undef(const std::string &key)
Undefine a variable with a specified key.
virtual void load(std::istream &is)
Load the DataSet from an input stream.
Node * node(const std::string &key)
Get the node corresponding to a variable with a specified key.
DataSet()
Constructor for DataSet.
DataSet & operator=(const DataSet &)=delete
kids_complex * def_complex(const std::string &key, Shape S=1, const std::string &info="")
Define a complex variable with a specified key, shape, and info.
std::tuple< kids_dtype, void *, Shape * > obtain(const std::string &key)
Obtain information about a variable with a specified key.
virtual std::string help(const std::string &name)
Get help information for a variable with a specified name.
DataSet & _def(const std::string &key, const std::string &key_in, const std::string &info="")
Define a variable with a specified key and reference key, and info.
kids_int * def_int(const std::string &key, Shape S=1, const std::string &info="")
Define an integer variable with a specified key, shape, and info.
kids_int * def(VARIABLE< kids_int > &var)
Define a variable of type kids_int.
std::shared_ptr< DataType > _data
kids_real * def_real(const std::string &key, Shape S=1, const std::string &info="")
Define a real variable with a specified key, shape, and info.
DataSet & _def_int(const std::string &key, Shape S=1, const std::string &info="")
Define an integer variable with a specified key, shape, and info and update the dataset.
Node class is an abstract interface.
Shape class provide information about of a Tensor's shape.
< http://warp.povusers.org/FunctionParser/fparser.html
double kids_real
Alias for real number type.
std::complex< double > kids_complex
Alias for complex number type.
int kids_int
Alias for integer type.