HAL
hal::BooleanFunctionEntry Class Reference

A BooleanFunctionTableEntry that represents a boolean function. More...

#include <boolean_function_table_model.h>

Inheritance diagram for hal::BooleanFunctionEntry:
Inheritance graph
Collaboration diagram for hal::BooleanFunctionEntry:
Collaboration graph

Public Member Functions

 BooleanFunctionEntry (u32 gateId, QString functionName, BooleanFunction bf)
 
 BooleanFunctionEntry (QString functionName, BooleanFunction bf)
 
BooleanFunction getBooleanFunction () const
 
QString getPythonCode () override
 
- Public Member Functions inherited from hal::BooleanFunctionTableEntry
 BooleanFunctionTableEntry (u32 gateId)
 
QString getEntryIdentifier () const
 
QString getEntryValueString () const
 
u32 getGateId () const
 
EntryType getEntryType () const
 

Additional Inherited Members

- Public Types inherited from hal::BooleanFunctionTableEntry
enum class  EntryType {
  BooleanFunctionStandard , CPBehavior , StateComp , FFComp ,
  LatchComp
}
 
- Protected Attributes inherited from hal::BooleanFunctionTableEntry
QString mLeft
 
QString mRight
 
u32 mGateId
 
EntryType mType
 

Detailed Description

A BooleanFunctionTableEntry that represents a boolean function.

Definition at line 112 of file boolean_function_table_model.h.

Constructor & Destructor Documentation

◆ BooleanFunctionEntry() [1/2]

hal::BooleanFunctionEntry::BooleanFunctionEntry ( u32  gateId,
QString  functionName,
BooleanFunction  bf 
)

Constructor to display a boolean function of a specific gate. Impacts the getPythonCode method (returns the actual code to get the bf).

Parameters
gateId- The id of the gate the boolean function belongs to
functionName- The name of the boolean function (e.g. "O")
bf- The boolean function

Definition at line 43 of file boolean_function_table_model.cpp.

References hal::BooleanFunctionTableEntry::BooleanFunctionStandard, QString::fromStdString(), hal::BooleanFunctionTableEntry::mLeft, hal::BooleanFunctionTableEntry::mRight, hal::BooleanFunctionTableEntry::mType, and hal::BooleanFunction::to_string().

◆ BooleanFunctionEntry() [2/2]

hal::BooleanFunctionEntry::BooleanFunctionEntry ( QString  functionName,
BooleanFunction  bf 
)

Constructor to display an arbitrary boolean function. Impacts the getPythonCode method (returns empty string in this case).

Parameters
functionName- The name of the boolean function (e.g. "O").
bf- The boolean function.

Definition at line 51 of file boolean_function_table_model.cpp.

References hal::BooleanFunctionTableEntry::BooleanFunctionStandard, QString::fromStdString(), hal::BooleanFunctionTableEntry::mLeft, hal::BooleanFunctionTableEntry::mRight, hal::BooleanFunctionTableEntry::mType, and hal::BooleanFunction::to_string().

Member Function Documentation

◆ getBooleanFunction()

BooleanFunction hal::BooleanFunctionEntry::getBooleanFunction ( ) const

Get the stored boolean function (copy).

Returns
the boolean function of the entry.

Definition at line 59 of file boolean_function_table_model.cpp.

◆ getPythonCode()

QString hal::BooleanFunctionEntry::getPythonCode ( )
overridevirtual

Returns the python code necessary to access the entry's value through a gate. This function should return an empty string if no python code is available. (E.g. when a "random" boolean function is displayed that belongs to no gate or component)

Returns
The python code if available or an empty string otherwise.

Reimplemented from hal::BooleanFunctionTableEntry.

Definition at line 64 of file boolean_function_table_model.cpp.

References hal::BooleanFunctionTableEntry::mGateId, hal::BooleanFunctionTableEntry::mLeft, and hal::PyCodeProvider::pyCodeGateBooleanFunction().


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