24 :
Scalar(other), data_(other.data_)
32 : data_(boost::make_shared<SelectionData>(name))
42 xprintf(
PrgErr,
"Declaration of new name: %s in finished Selection type: %s\n", key.c_str(),
type_name().c_str());
44 data_->add_value(value, key, description);
58 THROW( ExcWrongDefault() << EI_DefaultStr( str ) << EI_TypeName(
type_name() +
" with values: "+
key_list() ));
64 return data_->finished;
69 return data_->type_name_;
74 return data_->type_name_;
89 if (it !=
data_->key_to_index_.end())
90 return (
data_->keys_[it->second].value);
92 throw ExcSelectionKeyNotFound() << EI_KeyName(key) << EI_Selection(*
this);
98 auto it =
data_->value_to_index_.find(val);
99 if (it !=
data_->value_to_index_.end())
100 return data_->keys_[it->second].key_;
102 throw ExcSelectionValueNotFound() << EI_Value(val) << EI_Selection(*
this);
108 for (
auto it = sel.
begin(); it != sel.
end(); ++it)
110 int value = it->value;
111 while (
data_->value_to_index_.find(value) !=
data_->value_to_index_.end()) value++;
112 add_value(value, it->key_, it->description_);
123 }
catch (ExcSelectionKeyNotFound &e) {
124 THROW( ExcWrongDefault() << EI_DefaultStr( str ) << EI_TypeName(
type_name() +
" with values: "+
key_list() ));
132 for(
unsigned int i=0; i<
size(); i++) os <<
"'" <<
data_->keys_[i].key_ <<
"' ";
147 PrgErr,
"Value %d of new name '%s' conflicts with value %d of previous name '%s' in Selection: '%s'.\n", value, key.c_str(),
keys_[it->second].value,
keys_[it->second].key_.c_str(),
type_name_.c_str());
155 Key tmp_key = { new_idx, key, description, value };
156 keys_.push_back(tmp_key);