HAL  v4.5.0-133-g64838ea8d
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
hal::ActionAddBooleanFunction Class Reference

Either adds a new function or changes an exisiting function of a given gate. More...

#include </home/runner/work/hal/hal/plugins/gui/include/gui/user_action/action_add_boolean_function.h>

Inheritance diagram for hal::ActionAddBooleanFunction:
Inheritance graph
Collaboration diagram for hal::ActionAddBooleanFunction:
Collaboration graph

Public Member Functions

 ActionAddBooleanFunction (QString booleanFuncName=QString(), BooleanFunction func=BooleanFunction(), u32 gateID=0)
 
bool exec () override
 
QString tagname () const override
 
void writeToXml (QXmlStreamWriter &xmlOut) const override
 
void readFromXml (QXmlStreamReader &xmlIn) override
 
void addToHash (QCryptographicHash &cryptoHash) const override
 
- Public Member Functions inherited from hal::UserAction
virtual ~UserAction ()
 
virtual UserActionObject object () const
 
virtual void setObject (const UserActionObject &obj)
 
int compoundOrder () const
 
void setCompoundOrder (int cmpord)
 
qint64 timeStamp () const
 
QString cryptographicHash (int recordNo) const
 
UserAction * undoAction () const
 
QString debugDump () const
 
void setObjectLock (bool lock)
 
void setParentObjectLock (bool lock)
 
bool hasProjectModified () const
 

Additional Inherited Members

- Protected Member Functions inherited from hal::UserAction
 UserAction ()
 
void writeParentObjectToXml (QXmlStreamWriter &xmlOut) const
 
void readParentObjectFromXml (QXmlStreamReader &xmlIn)
 
- Static Protected Member Functions inherited from hal::UserAction
static QString setToText (const QSet< u32 > &set)
 
static QSet< u32 > setFromText (const QString &s)
 
static QString gridToText (const QHash< hal::Node, QPoint > &grid)
 
static QHash< hal::Node, QPoint > gridFromText (const QString &txt)
 
- Protected Attributes inherited from hal::UserAction
UserActionObject mObject
 
UserActionObject mParentObject
 
int mCompoundOrder
 
UserAction * mUndoAction
 
qint64 mTimeStamp
 
bool mObjectLock
 
bool mParentObjectLock
 
bool mProjectModified
 

Detailed Description

Either adds a new function or changes an exisiting function of a given gate.

To add a new function to a gate, a function name must be given that is not currently in use. If a function name is given that already exists in the gate, the corresponding function is overwritten with the new one. The undo action is either a DeleteBooleanFunction- or AddBooleanFunction-Action, depending on wether a new one was added or an already existing modified.

Definition at line 43 of file action_add_boolean_function.h.

Constructor & Destructor Documentation

◆ ActionAddBooleanFunction()

hal::ActionAddBooleanFunction::ActionAddBooleanFunction ( QString  booleanFuncName = QString(),
BooleanFunction  func = BooleanFunction(),
u32  gateID = 0 
)

Definition at line 18 of file action_add_boolean_function.cpp.

References hal::UserActionObjectType::Gate, and hal::UserAction::setObject().

Referenced by exec().

Member Function Documentation

◆ addToHash()

void hal::ActionAddBooleanFunction::addToHash ( QCryptographicHash &  cryptoHash) const
overridevirtual

Hook for derived classes to add parameter to cryptographic hash.

Parameters
cryptoHash- Additional hash data.

Reimplemented from hal::UserAction.

Definition at line 65 of file action_add_boolean_function.cpp.

References QCryptographicHash::addData(), QString::fromStdString(), hal::BooleanFunction::to_string(), and QString::toUtf8().

◆ exec()

bool hal::ActionAddBooleanFunction::exec ( )
overridevirtual

Executes user interaction and returns true on success. Note: Each implementation of exec() must include a call to the exec() method of base class to store the UserAction object in history and to transfer its ownership.

Returns
true on success, false otherwise.

Reimplemented from hal::UserAction.

Definition at line 24 of file action_add_boolean_function.cpp.

References ActionAddBooleanFunction(), hal::UserAction::exec(), hal::Gate::get_boolean_function(), hal::Netlist::get_gate_by_id(), hal::gNetlist, hal::UserActionObject::id(), hal::UserAction::mObject, hal::UserAction::mUndoAction, and QString::toStdString().

◆ readFromXml()

void hal::ActionAddBooleanFunction::readFromXml ( QXmlStreamReader &  xmlIn)
overridevirtual

Reads user interaction as well as arguments from xml macro file.

Parameters
xmlIn- The xml reader.

Reimplemented from hal::UserAction.

Definition at line 50 of file action_add_boolean_function.cpp.

References hal::BooleanFunction::from_string(), QXmlStreamReader::name(), QXmlStreamReader::readElementText(), QXmlStreamReader::readNextStartElement(), and QString::toStdString().

◆ tagname()

QString hal::ActionAddBooleanFunction::tagname ( ) const
overridevirtual

The xml tagname for the action is purely virtual and needs to be implemented in derived class.

Returns
The tagname.

Implements hal::UserAction.

Definition at line 39 of file action_add_boolean_function.cpp.

References hal::ActionAddBooleanFunctionFactory::sFactory, and hal::UserActionFactory::tagname().

◆ writeToXml()

void hal::ActionAddBooleanFunction::writeToXml ( QXmlStreamWriter &  xmlOut) const
overridevirtual

Persist user interaction in xml macro file.

Parameters
xmlOut- The xml writer.

Reimplemented from hal::UserAction.

Definition at line 44 of file action_add_boolean_function.cpp.

References QString::fromStdString(), hal::BooleanFunction::to_string(), and QXmlStreamWriter::writeTextElement().


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