4#include <collections.h>
11 collections_map<std::string, ISpecDataValue*> _values;
16 function_pointer(
this, &SpecDataValueCollection::merge_foreach);
20 for (
auto& [key, value] : _values)
delete value;
25 auto found = _values.find(key);
26 return found == _values.end() ? nullptr : found->second;
28 bool has(
const char* key)
const override {
29 auto found = _values.find(key);
30 return found != _values.end();
33 for (
auto& [key, value] : _values) fn->invoke(value);
38 void clear()
override { _values.clear(); }
ISpecDataValue * get(const char *key) const override
void foreach_value(ForEachSpecDataFn *fn) const override
bool has(const char *key) const override
void merge(ISpecDataValueCollection *other) override
~SpecDataValueCollection() override
void add(ISpecDataValue *value) override
IFunctionPointer< void(ISpecDataValue *)> ForEachSpecDataFn
virtual void foreach_value(ForEachSpecDataFn *) const =0
virtual const char * key() const =0