18 #ifndef TYPE_SELECTION_HH_ 19 #define TYPE_SELECTION_HH_ 76 <<
"Key " << EI_KeyName::qval <<
" not found in Selection:\n" << EI_Selection::val );
78 <<
"Value " << EI_Value::val <<
" not found in Selection:\n" << EI_Selection::val );
100 Selection(
const string &name,
const std::string &description =
"");
121 TypeHash content_hash()
const override;
128 bool is_finished()
const override;
135 string type_name()
const override;
137 string class_name()
const override;
147 inline keys_const_iterator begin()
const;
154 inline keys_const_iterator end()
const;
157 inline keys_const_iterator key_iterator(
const string& key)
const;
164 int name_to_int(
const string &key)
const;
171 string int_to_name(
const int &value)
const;
177 inline bool has_name(
const string &key)
const;
180 inline bool has_value(
const int &val)
const;
183 inline unsigned int size()
const;
190 bool is_closed()
const override;
198 void finished_check()
const;
205 string key_list()
const;
219 void add_value(
const int value,
const std::string &key,
250 std::shared_ptr<SelectionData>
data_;
265 return (data_->key_to_index_.find(key_h) != data_->key_to_index_.end());
272 return (data_->value_to_index_.find(val) != data_->value_to_index_.end());
279 ASSERT_EQ(data_->keys_.size(), data_->key_to_index_.size()).error();
280 return data_->keys_.size();
287 ASSERT(data_->closed_)(this->type_name()).error();
295 return data_->keys_.begin();
303 return data_->keys_.end();
310 return begin() + name_to_int(key);
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
static constexpr bool value
bool operator==(const Null &, const Null &)
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual)