29 #include <boost/type_traits.hpp> 30 #include <boost/tokenizer.hpp> 31 #include <boost/shared_ptr.hpp> 32 #include <boost/make_shared.hpp> 33 #include <boost/algorithm/string.hpp> 59 <<
" do not match type: " << EI_TypeName::qval <<
";\n" 60 <<
"During declaration of the key: " << EI_KeyName::qval );
85 typedef std::pair< std::string, std::shared_ptr<TypeBase> >
ParameterPair;
143 {
return typeid(*this) ==
typeid(other); }
147 {
return ! (*
this == other); }
162 static void lazy_finish();
177 virtual bool finish(
bool is_generic =
false)
187 virtual TypeHash content_hash()
const =0;
194 static std::string hash_str(TypeHash hash);
198 return hash_str(content_hash());
206 virtual MakeInstanceReturnType make_instance(ParameterVector vec = ParameterVector()) =0;
210 return root_of_generic_subtree_;
226 void add_attribute_(std::string name, json_string val);
238 inline static KeyHash
key_hash(
const string &str) {
248 static bool is_valid_identifier(
const string& key);
251 bool validate_json(json_string str)
const;
254 json_string print_parameter_map_to_json(ParameterMap parameter_map)
const;
260 json_string print_parameter_map_keys_to_json(ParameterMap param_map)
const;
266 void set_generic_attributes(ParameterMap param_map);
271 void copy_attributes(attribute_map other_attributes);
329 : lower_bound_(min_size), upper_bound_(max_size), finished(false)
332 bool finish(
bool is_generic =
false);
351 template <
class ValueType>
352 Array(
const ValueType &type,
unsigned int min_size=0,
unsigned int max_size=std::numeric_limits<unsigned int>::max() );
357 Array(std::shared_ptr<TypeBase> type,
unsigned int min_size=0,
unsigned int max_size=std::numeric_limits<unsigned int>::max() );
364 TypeHash content_hash()
const override;
367 bool finish(
bool is_generic =
false)
override;
371 return data_->finished; }
375 return *data_->type_of_values_; }
379 return size >=data_->lower_bound_ && size<=data_->upper_bound_; }
386 string type_name()
const override;
401 Array deep_copy()
const;
436 TypeHash content_hash()
const override;
444 string type_name()
const override;
469 Integer(
int lower_bound=std::numeric_limits<int>::min(),
int upper_bound=std::numeric_limits<int>::max())
470 : lower_bound_(lower_bound), upper_bound_(upper_bound)
478 TypeHash content_hash()
const override;
485 bool match(std::int64_t value)
const;
492 string type_name()
const override;
522 Double(
double lower_bound= -std::numeric_limits<double>::max(),
double upper_bound=std::numeric_limits<double>::max())
523 : lower_bound_(lower_bound), upper_bound_(upper_bound)
531 TypeHash content_hash()
const override;
534 bool match(
double value)
const;
541 string type_name()
const override;
570 virtual string type_name()
const override;
575 TypeHash content_hash()
const override;
578 virtual bool match(
const string &value)
const;
596 TypeHash content_hash()
const override;
615 string type_name()
const override;
621 {
return typeid(*this) ==
typeid(other) &&
622 (type_== static_cast<const FileName *>(&other)->get_file_type() );
626 bool match(
const string &str)
const;
FileType
Possible types of file.
bool operator==(const Null &, const Null &)
Global macros to enhance readability and debugging, general constants.