void Connector::connect(const Logic &logic)
{
- const list<Logic::WidgetAction> &logic_acts=logic.get_actions();
+ const list<Logic::WidgetBinding> &logic_binds = logic.get_bindings();
- for(list<Logic::WidgetAction>::const_iterator i=logic_acts.begin(); i!=logic_acts.end(); ++i)
+ for(list<Logic::WidgetBinding>::const_iterator i=logic_binds.begin(); i!=logic_binds.end(); ++i)
{
- map<string, ConnAction *>::const_iterator j=actions.find(i->type);
+ map<string, ConnAction *>::const_iterator j = actions.find(i->type);
if(j!=actions.end())
j->second->connect(*this, *i->wdg, i->data);
+ else
+ throw KeyError("Unknown binding type", i->type);
}
}
void Connector::add(const string &type, ConnAction *act)
{
- map<string, ConnAction *>::iterator i=actions.find(type);
+ map<string, ConnAction *>::iterator i = actions.find(type);
if(i!=actions.end())
{
delete i->second;
- i->second=act;
+ i->second = act;
}
else
- actions[type]=act;
+ actions[type] = act;
}
} // namespace GLtk