HAL  v4.5.0-251-g305763a14
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
gate_type_component.cpp
Go to the documentation of this file.
2 
3 namespace hal
4 {
5  template<>
6  std::map<GateTypeComponent::ComponentType, std::string> EnumStrings<GateTypeComponent::ComponentType>::data = {{GateTypeComponent::ComponentType::lut, "lut"},
15 
16  GateTypeComponent* GateTypeComponent::get_component(const std::function<bool(const GateTypeComponent*)>& filter) const
17  {
18  std::vector<GateTypeComponent*> components = this->get_components(filter);
19 
20  if (components.size() == 1)
21  {
22  return *components.begin();
23  }
24 
25  return nullptr;
26  }
27 } // namespace hal
virtual std::vector< GateTypeComponent * > get_components(const std::function< bool(const GateTypeComponent *)> &filter=nullptr) const =0
GateTypeComponent * get_component(const std::function< bool(const GateTypeComponent *)> &filter=nullptr) const
Definition: defines.h:45