23 void AbstractHandlerWithState::AddState(
const QString& stateId,
const SmartPointer<State>& state)
27 throw ctkInvalidArgumentException(
"Cannot add a null state");
30 states.insert(stateId, state);
31 state->AddListener(
this);
37 QHash<QString,State::Pointer>::const_iterator i = states.find(stateId);
38 if (i != states.end())
return *i;
51 throw ctkInvalidArgumentException(
"Cannot remove a null state");
54 QHash<QString,State::Pointer>::iterator i = states.find(stateId);
55 if (i != states.end())
57 (*i)->RemoveListener(
this);
Implements transparent reference counting.
virtual void HandleStateChange(const SmartPointer< State > &state, const SmartPointer< Object > &oldValue)=0
berry::SmartPointer< Self > Pointer
void RemoveState(const QString &stateId) override
QList< QString > GetStateIds() const override
SmartPointer< State > GetState(const QString &stateId) const override