15 #ifndef SERIALBOX_CORE_FRONTEND_GRIDTOOLS_META_INFO_MAP_H 16 #define SERIALBOX_CORE_FRONTEND_GRIDTOOLS_META_INFO_MAP_H 120 map_impl_ = std::make_shared<MetainfoMapImpl>(list);
136 return meta_info_map(std::make_shared<MetainfoMapImpl>(*map_impl_));
140 explicit meta_info_map(
const std::shared_ptr<MetainfoMapImpl>& map) { map_impl_ = map; }
147 template <
class StringType>
148 bool has_key(StringType&& key)
const noexcept {
149 return map_impl_->hasKey(std::forward<StringType>(key));
160 std::vector<std::string>
keys()
const {
return map_impl_->keys(); }
169 std::vector<TypeID>
types()
const {
return map_impl_->types(); }
179 template <
class StringType>
181 return map_impl_->find(std::forward<StringType>(key));
183 template <
class StringType>
185 return map_impl_->find(std::forward<StringType>(key));
198 template <
class KeyType,
class ValueType>
199 bool insert(KeyType&& key, ValueType&& value) noexcept {
200 return map_impl_->insert(std::forward<KeyType>(key), std::forward<ValueType>(value));
213 template <
class ValueType,
class KeyType>
214 ValueType
as(KeyType&& key)
const {
215 return map_impl_->at(std::forward<KeyType>(key)).template as<ValueType>();
224 return map_impl_->erase(first, last);
243 std::size_t
size() const noexcept {
return map_impl_->size(); }
247 bool empty() const noexcept {
return map_impl_->empty(); }
251 void clear() noexcept { map_impl_->clear(); }
266 return (*map_impl_ == *right.map_impl_);
274 return (stream << *s.map_impl_);
278 const std::shared_ptr<MetainfoMapImpl>&
impl()
const {
return map_impl_; }
281 std::shared_ptr<MetainfoMapImpl> map_impl_;
Namespace of the serialbox library.