9 #include "../utils/runtime_error.h" 31 if (!name.is_string())
36 return std::dynamic_pointer_cast<
Element>(
45 if (!name.is_string())
60 item.second->accessed_by_instance_of(classname);
72 keys.insert(item.first);
ShPtr< Element > ElPtr
An alias for a shared pointer of Element class.
This file has a definition of GenDict class.
virtual ElPtr get_element(const Json &name=nullptr) override
Get a value in generator_dict as a shared pointer of Element class.
std::string Str
Str is an alias for string.
nlohmann::json Json
Json is an alias for nlohmann::json.
Map< Str, ShPtr< Generator > > generator_dict
std::unordered_set< T > Set
Set is an alias for unordered set (same as set in Python).
void merge_update_chain(const Vec< UpdatePair > &new_chain)
virtual void accessed_by_instance_of(const Str &classname) override
Set class name of an instance calling Element::check_required_keys.
Element inherits Generator class and contains data element (or entity) as a Json object.
void runtime_error(const Str &msg)
Raise (for Python) and throw (for C++) a runtime error.
virtual ShPtr< Generator > get_generator(const Json &name=nullptr) override
Get a value in generator_dict as a shared pointer of Generator class.
Namespace for utility functions.
GenDict(const Map< Str, ShPtr< Generator >> &generator_dict_)
Constructor of GenDict class.
std::shared_ptr< T > ShPtr
ShPtr is an alias for shared pointer.
Set< Str > get_keys()
Get a set of the keys of generator_dict.
std::unordered_map< T, U > Map
Map is an alias for unordered map (same as dict in Python).