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 );
128 virtual bool is_finished()
const;
133 virtual bool is_closed()
const;
136 virtual string type_name()
const;
138 virtual string class_name()
const;
170 bool operator!=(
const TypeBase & other)
const;
186 static void delete_unfinished_types();
216 virtual TypeHash content_hash()
const =0;
223 static std::string hash_str(TypeHash hash);
227 return hash_str(content_hash());
235 virtual MakeInstanceReturnType make_instance(ParameterVector vec = ParameterVector()) =0;
239 return root_of_generic_subtree_;
255 void add_attribute_(std::string name, json_string val);
267 inline static KeyHash
key_hash(
const string &str) {
277 static bool is_valid_identifier(
const string& key);
280 bool validate_json(json_string str)
const;
283 json_string print_parameter_map_to_json(ParameterMap parameter_map)
const;
289 json_string print_parameter_map_keys_to_json(ParameterMap param_map)
const;
295 void set_generic_attributes(ParameterMap param_map);
300 void copy_attributes(attribute_map other_attributes);
357 ArrayData(
unsigned int min_size,
unsigned int max_size);
378 template <
class ValueType>
379 Array(
const ValueType &type,
unsigned int min_size=0,
unsigned int max_size=std::numeric_limits<unsigned int>::max() );
384 Array(std::shared_ptr<TypeBase> type,
unsigned int min_size=0,
unsigned int max_size=std::numeric_limits<unsigned int>::max() );
391 TypeHash content_hash()
const override;
400 bool is_finished()
const override;
404 return *data_->type_of_values_; }
408 return size >=data_->lower_bound_ && size<=data_->upper_bound_; }
415 string type_name()
const override;
417 string class_name()
const override;
430 Array deep_copy()
const;
465 TypeHash content_hash()
const override;
473 string type_name()
const override;
475 string class_name()
const override;
498 Integer(
int lower_bound=std::numeric_limits<int>::min(),
int upper_bound=std::numeric_limits<int>::max());
505 TypeHash content_hash()
const override;
512 bool match(std::int64_t
value)
const;
519 string type_name()
const override;
521 string class_name()
const override;
549 Double(
double lower_bound= -std::numeric_limits<double>::max(),
double upper_bound=std::numeric_limits<double>::max());
556 TypeHash content_hash()
const override;
559 bool match(
double value)
const;
566 string type_name()
const override;
568 string class_name()
const override;
595 virtual string type_name()
const override;
597 string class_name()
const override;
600 TypeHash content_hash()
const override;
603 virtual bool match(
const string &
value)
const;
621 TypeHash content_hash()
const override;
638 string type_name()
const override;
640 string class_name()
const override;
646 bool match(
const string &str)
const override;
667 FileName(enum ::FilePath::FileType type);
FileType
Possible types of file.
static constexpr bool value
bool operator==(const Null &, const Null &)