5 StateComponent::StateComponent(std::unique_ptr<GateTypeComponent> component,
const std::string& state_identifier,
const std::string& neg_state_identifier)
6 : m_component(
std::move(component)), m_state_identifier(state_identifier), m_neg_state_identifier(neg_state_identifier)
17 return component->
get_type() == m_type;
22 if (m_component !=
nullptr)
24 std::vector<GateTypeComponent*> res = m_component->get_components(filter);
27 if (filter(m_component.get()))
29 res.push_back(m_component.get());
34 res.push_back(m_component.get());
45 return m_state_identifier;
50 m_state_identifier = state_identifier;
55 return m_neg_state_identifier;
60 m_neg_state_identifier = neg_state_identifier;
virtual ComponentType get_type() const =0
const std::string & get_state_identifier() const
void set_state_identifier(const std::string &state_identifier)
ComponentType get_type() const override
static bool is_class_of(const GateTypeComponent *component)
const std::string & get_neg_state_identifier() const
std::vector< GateTypeComponent * > get_components(const std::function< bool(const GateTypeComponent *)> &filter=nullptr) const override
StateComponent(std::unique_ptr< GateTypeComponent > component, const std::string &state_identifier, const std::string &neg_state_identifier)
void set_neg_state_identifier(const std::string &neg_state_identifier)