7 FFComponent::FFComponent(std::unique_ptr<GateTypeComponent> component,
const BooleanFunction& next_state_bf,
const BooleanFunction& clock_bf)
8 : m_component(
std::move(component)), m_next_state_bf(next_state_bf.clone()), m_clock_bf(clock_bf.clone())
12 std::unique_ptr<FFComponent> FFComponent::create(std::unique_ptr<GateTypeComponent> component,
const BooleanFunction& next_state_bf,
const BooleanFunction& clock_bf)
14 return std::unique_ptr<FFComponent>(
new FFComponent(std::move(component), next_state_bf.
clone(), clock_bf.
clone()));
24 return component->
get_type() == m_type;
27 std::vector<GateTypeComponent*> FFComponent::get_components(
const std::function<
bool(
const GateTypeComponent*)>& filter)
const
29 if (m_component !=
nullptr)
31 std::vector<GateTypeComponent*> res = m_component->get_components(filter);
34 if (filter(m_component.get()))
36 res.push_back(m_component.get());
41 res.push_back(m_component.get());
52 return m_next_state_bf.
clone();
57 m_next_state_bf = next_state_bf.
clone();
62 return m_clock_bf.
clone();
67 m_clock_bf = clock_bf.
clone();
72 return m_async_reset_bf.
clone();
77 m_async_reset_bf = async_reset_bf.
clone();
82 return m_async_set_bf.
clone();
87 m_async_set_bf = async_set_bf.
clone();
90 const std::pair<AsyncSetResetBehavior, AsyncSetResetBehavior>& FFComponent::get_async_set_reset_behavior()
const
92 return m_async_set_reset_behavior;
97 m_async_set_reset_behavior = std::make_pair(behav_state, behav_neg_state);
BooleanFunction clone() const
virtual ComponentType get_type() const =0