9 const std::regex pattern(
"([^{<:]*)(?:\\{([^@<]*)(?:@(.*?))?\\})?(?:<([^>]*)>)?(?::([^:]*))?");
11 if (std::regex_match(
tokenString, match, pattern)) {
13 match[1], match[2], match[3], match[4], match[5]);
15 throw kids_error(
"cannot match variable pattern!");
24 if (time ==
"" || time ==
"T") time =
"t";
30 }
else if (
type ==
"C") {
43 std::cout <<
LOC() <<
"VariableDescriptor Data:\n"
45 <<
".name = " <<
name <<
"\n"
46 <<
".field = " <<
field <<
"\n"
47 <<
".index = " <<
index <<
"\n"
48 <<
".type = " <<
type <<
"\n"
49 <<
".time = " << time <<
"\n"
50 <<
".dataType = " <<
dataType <<
"\n"
57 const std::vector<std::size_t>& cxxshape) {
60 std::cout <<
LOC() << key <<
"," << data_type <<
"\n";
64 DS->def_real(key, cxxshape,
"CUSTOM DEFINED");
67 DS->def_complex(key, cxxshape,
"CUSTOM DEFINED");
71 std::cout <<
LOC() << key <<
"\n";
provide VariableDescriptor class
#define LOC()
show the location information for debug
< http://warp.povusers.org/FunctionParser/fparser.html
@ kids_real_type
Represents real number type.
@ kids_complex_type
Represents complex number type.
@ kids_void_type
Represents void type.
std::basic_string< CharT > concat(const separator_t< CharT > &sep, Args &&... seq)
std::string name
The name of the variable.
void referIn(std::shared_ptr< DataSet > &DS)
Associates the variable with data in the DataSet.
kids_dtype dataType
The data type of the variable.
VariableDescriptor(const std::string &token_string)
Constructs a VariableDescriptor object.
std::string tokenString
The input token string.
void defineIn(std::shared_ptr< DataSet > &DS, kids_dtype data_type, const std::vector< std::size_t > &cxxshape)
Define variable with data in the DataSet.
Shape * shape
Pointer to the shape of the variable.
std::string field
The field of the variable.
void * dataPointer
Pointer to the data of the variable.
std::string type
The type of the variable.
std::string index
The index of the variable.