30 #include <boost/exception/info.hpp> 63 DECLARE_EXCEPTION( ExcWrongDefaultJSON, <<
"Consistency Error: Not valid JSON of Default value " 64 << EI_DefaultStr::qval <<
" of type " << EI_TypeName::qval <<
";\n" 65 <<
"During declaration of the key: " << EI_KeyName::qval );
66 DECLARE_EXCEPTION( ExcWrongDefault, <<
"Consistency Error: " << EI_Desc::val <<
"Default value " 67 << EI_DefaultStr::qval <<
" do not match type: " << EI_TypeName::qval <<
";\n" 68 <<
"During declaration of the key: " << EI_KeyName::qval );
69 DECLARE_EXCEPTION( ExcUnknownDescendant, <<
"Unknown descendant of TypeBase class, name: " << EI_TypeName::qval );
103 const static TypeHash none_hash = std::numeric_limits<TypeHash>::max();
129 virtual bool is_finished()
const;
134 virtual bool is_closed()
const;
137 virtual string type_name()
const;
139 virtual string class_name()
const;
171 bool operator!=(
const TypeBase & other)
const;
187 static void delete_unfinished_types();
217 virtual TypeHash content_hash()
const =0;
224 static std::string hash_str(TypeHash hash);
228 return hash_str(content_hash());
236 virtual MakeInstanceReturnType make_instance(ParameterVector vec = ParameterVector()) =0;
240 return root_of_generic_subtree_;
256 void add_attribute_(std::string name, json_string val);
268 inline static KeyHash
key_hash(
const string &str) {
278 static bool is_valid_identifier(
const string& key);
281 bool validate_json(json_string str)
const;
284 json_string print_parameter_map_to_json(ParameterMap parameter_map)
const;
290 json_string print_parameter_map_keys_to_json(ParameterMap param_map)
const;
296 void set_generic_attributes(ParameterMap param_map);
301 void copy_attributes(attribute_map other_attributes);
358 ArrayData(
unsigned int min_size,
unsigned int max_size);
379 template <
class ValueType>
380 Array(
const ValueType &type,
unsigned int min_size=0,
unsigned int max_size=std::numeric_limits<unsigned int>::max() );
385 Array(std::shared_ptr<TypeBase> type,
unsigned int min_size=0,
unsigned int max_size=std::numeric_limits<unsigned int>::max() );
392 TypeHash content_hash()
const override;
401 bool is_finished()
const override;
405 return *data_->type_of_values_; }
409 return size >=data_->lower_bound_ && size<=data_->upper_bound_; }
416 string type_name()
const override;
418 string class_name()
const override;
431 Array deep_copy()
const;
466 TypeHash content_hash()
const override;
474 string type_name()
const override;
476 string class_name()
const override;
499 Integer(
int lower_bound=std::numeric_limits<int>::min(),
int upper_bound=std::numeric_limits<int>::max());
506 TypeHash content_hash()
const override;
513 bool match(std::int64_t
value)
const;
520 string type_name()
const override;
522 string class_name()
const override;
550 Double(
double lower_bound= -std::numeric_limits<double>::max(),
double upper_bound=std::numeric_limits<double>::max());
557 TypeHash content_hash()
const override;
560 bool match(
double value)
const;
567 string type_name()
const override;
569 string class_name()
const override;
596 virtual string type_name()
const override;
598 string class_name()
const override;
601 TypeHash content_hash()
const override;
604 virtual bool match(
const string &
value)
const;
622 TypeHash content_hash()
const override;
639 string type_name()
const override;
641 string class_name()
const override;
647 bool match(
const string &str)
const override;
668 FileName(enum ::FilePath::FileType type);
FileType
Possible types of file.
static constexpr bool value
bool operator==(const Null &, const Null &)