HAL
hal::StateComponent Class Reference

#include <state_component.h>

Inheritance diagram for hal::StateComponent:
Inheritance graph
Collaboration diagram for hal::StateComponent:
Collaboration graph

Public Member Functions

 StateComponent (std::unique_ptr< GateTypeComponent > component, const std::string &state_identifier, const std::string &neg_state_identifier)
 
ComponentType get_type () const override
 
std::vector< GateTypeComponent * > get_components (const std::function< bool(const GateTypeComponent *)> &filter=nullptr) const override
 
const std::string & get_state_identifier () const
 
void set_state_identifier (const std::string &state_identifier)
 
const std::string & get_neg_state_identifier () const
 
void set_neg_state_identifier (const std::string &neg_state_identifier)
 
- Public Member Functions inherited from hal::GateTypeComponent
virtual ~GateTypeComponent ()=default
 
template<typename T >
T * convert_to ()
 
template<typename T >
const T * convert_to () const
 
GateTypeComponentget_component (const std::function< bool(const GateTypeComponent *)> &filter=nullptr) const
 
template<typename T >
T * get_component_as (const std::function< bool(const GateTypeComponent *)> &filter=nullptr)
 

Static Public Member Functions

static bool is_class_of (const GateTypeComponent *component)
 
- Static Public Member Functions inherited from hal::GateTypeComponent
static std::unique_ptr< GateTypeComponentcreate_lut_component (std::unique_ptr< GateTypeComponent > component, bool init_ascending)
 
static std::unique_ptr< GateTypeComponentcreate_ff_component (std::unique_ptr< GateTypeComponent > component, const BooleanFunction &next_state_bf, const BooleanFunction &clock_bf)
 
static std::unique_ptr< GateTypeComponentcreate_latch_component (std::unique_ptr< GateTypeComponent > component)
 
static std::unique_ptr< GateTypeComponentcreate_ram_component (std::unique_ptr< GateTypeComponent > component, const u32 bit_size)
 
static std::unique_ptr< GateTypeComponentcreate_mac_component ()
 
static std::unique_ptr< GateTypeComponentcreate_init_component (const std::string &init_category, const std::vector< std::string > &init_identifiers)
 
static std::unique_ptr< GateTypeComponentcreate_state_component (std::unique_ptr< GateTypeComponent > component, const std::string &state_identifier, const std::string &neg_state_identifier)
 
static std::unique_ptr< GateTypeComponentcreate_ram_port_component (std::unique_ptr< GateTypeComponent > component, const std::string &data_group, const std::string &addr_group, const BooleanFunction &clock_bf, const BooleanFunction &enable_bf, bool is_write)
 

Additional Inherited Members

- Public Types inherited from hal::GateTypeComponent
enum class  ComponentType {
  lut , ff , latch , ram ,
  mac , init , state , ram_port
}
 

Detailed Description

Definition at line 33 of file state_component.h.

Constructor & Destructor Documentation

◆ StateComponent()

hal::StateComponent::StateComponent ( std::unique_ptr< GateTypeComponent component,
const std::string &  state_identifier,
const std::string &  neg_state_identifier 
)

Construct a new StateComponent with given child component and the internal state identifiers.

Parameters
[in]component- Another component to be added as a child component.
[in]state_identifier- The identifier of the internal state.
[in]neg_state_identifier- The identifier of the negated internal state.

Definition at line 5 of file state_component.cpp.

Member Function Documentation

◆ get_components()

std::vector< GateTypeComponent * > hal::StateComponent::get_components ( const std::function< bool(const GateTypeComponent *)> &  filter = nullptr) const
overridevirtual

Get the sub-components of the gate type component. A user-defined filter may be applied to the result vector, but is disabled by default.

Parameters
[in]filter- The user-defined filter function applied to all candidate components.
Returns
The sub-components of the gate type component.

Implements hal::GateTypeComponent.

Definition at line 20 of file state_component.cpp.

◆ get_neg_state_identifier()

const std::string & hal::StateComponent::get_neg_state_identifier ( ) const

Get the identifier of the negated internal state.

Returns
The identifier of the negated internal state.

Definition at line 53 of file state_component.cpp.

Referenced by hal::gate_type_components_init(), and hal::TEST_F().

◆ get_state_identifier()

const std::string & hal::StateComponent::get_state_identifier ( ) const

Get the identifier of the internal state.

Returns
The identifier of the internal state.

Definition at line 43 of file state_component.cpp.

Referenced by hal::gate_type_components_init(), and hal::TEST_F().

◆ get_type()

StateComponent::ComponentType hal::StateComponent::get_type ( ) const
overridevirtual

Get the type of the gate type component.

Returns
The type of the gate type component.

Implements hal::GateTypeComponent.

Definition at line 10 of file state_component.cpp.

◆ is_class_of()

bool hal::StateComponent::is_class_of ( const GateTypeComponent component)
static

Check whether a component is a StateComponent.

Parameters
[in]component- The component to check.
Returns
True if component is a StateComponent, false otherwise.

Definition at line 15 of file state_component.cpp.

References hal::GateTypeComponent::get_type().

Referenced by hal::gate_type_components_init(), hal::StateWizardPage::setData(), hal::TEST_F(), and hal::GatelibraryFrameState::update().

◆ set_neg_state_identifier()

void hal::StateComponent::set_neg_state_identifier ( const std::string &  neg_state_identifier)

Get the identifier of the negated internal state.

Parameters
[in]neg_state_identifier- The identifier of the negated internal state.

Definition at line 58 of file state_component.cpp.

Referenced by hal::gate_type_components_init().

◆ set_state_identifier()

void hal::StateComponent::set_state_identifier ( const std::string &  state_identifier)

Get the identifier of the internal state.

Parameters
[in]state_identifier- The identifier of the internal state.

Definition at line 48 of file state_component.cpp.

Referenced by hal::gate_type_components_init().


The documentation for this class was generated from the following files: