Skip to content

Commit 43e09d8

Browse files
committed
tests pass
1 parent 964610d commit 43e09d8

File tree

1 file changed

+5
-0
lines changed
  • include/maxplus/base/fsm

1 file changed

+5
-0
lines changed

include/maxplus/base/fsm/fsm.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ class SetOfStates : public std::map<CId, std::shared_ptr<State>> {
169169
public:
170170
void remove(const State &s) { this->erase(s.getId()); }
171171
virtual ~SetOfStates() = default;
172+
void addState(const std::shared_ptr<State> &s) {
173+
this->insert(std::make_pair(s->getId(), s));
174+
}
175+
172176
State& withId(const CId id) {
173177
return *this->at(id);
174178
}
@@ -384,6 +388,7 @@ class SetOfStates : public Abstract::SetOfStates {
384388
}
385389

386390
void addState(std::shared_ptr<State<StateLabelType, EdgeLabelType>>& s) {
391+
Abstract::SetOfStates::addState(std::dynamic_pointer_cast<Abstract::State>(s));
387392
this->addToStateIndex(s->getLabel(), s);
388393
}
389394

0 commit comments

Comments
 (0)