OpenASIP
2.0
|
#include <OperationTriggeredFormat.hh>
Public Member Functions | |
OperationTriggeredFormat (const std::string &name, Machine &owner) | |
OperationTriggeredFormat (const ObjectState *state, Machine &owner) | |
virtual | ~OperationTriggeredFormat () |
void | addOperation (const std::string &op) |
void | removeOperation (const std::string &op) |
std::vector< std::string > | operations () const |
int | operationCount () const |
std::string | operation (int index) const |
bool | hasOperation (const std::string &opName) const |
void | addOperand (OperationTriggeredOperand &operand) |
std::vector< OperationTriggeredOperand * > | operands () const |
virtual void | setMachine (Machine &machine) |
virtual void | unsetMachine () |
virtual void | loadState (const ObjectState *state) |
virtual ObjectState * | saveState () const |
![]() | |
virtual | ~Component () |
virtual TCEString | name () const |
virtual void | setName (const std::string &name) |
virtual Machine * | machine () const |
virtual void | ensureRegistration (const Component &component) const |
virtual bool | isRegistered () const |
![]() | |
virtual | ~Serializable () |
Static Public Attributes | |
static const std::string | OSNAME_FORMAT = "ota-format" |
static const std::string | OSKEY_OPERATION = "ota-operation" |
![]() | |
static const std::string | OSNAME_COMPONENT = "component" |
ObjectState name for component. More... | |
static const std::string | OSKEY_NAME = "name" |
ObjectState attribute key for the name of the component. More... | |
Private Attributes | |
std::vector< std::string > | operations_ |
std::vector< OperationTriggeredOperand * > | operands_ |
Additional Inherited Members | |
![]() | |
Component (const std::string &name) | |
Component (const ObjectState *state) | |
void | internalSetMachine (Machine &machine) |
void | internalUnsetMachine () |
![]() | |
MachinePart () | |
virtual | ~MachinePart () |
Definition at line 44 of file OperationTriggeredFormat.hh.
TTAMachine::OperationTriggeredFormat::OperationTriggeredFormat | ( | const std::string & | name, |
Machine & | owner | ||
) |
The constructor.
Registers the operation code encoding to the parent binary encoding automatically.
parent | The parent OperationTriggeredFormat. |
Definition at line 56 of file OperationTriggeredFormat.cc.
References setMachine().
TTAMachine::OperationTriggeredFormat::OperationTriggeredFormat | ( | const ObjectState * | state, |
Machine & | owner | ||
) |
The constructor
Loads the state of the operation code encoding from the given ObjectState tree
state | The ObjectState tree |
parent | The parent binary encoding map |
ObjectStateLoadingException | If an error occurs while loading the state. |
Definition at line 74 of file OperationTriggeredFormat.cc.
References loadState(), TTAMachine::Component::name(), setMachine(), Texts::TextGenerator::text(), MOMTextGenerator::TXT_IT_EXISTS_BY_NAME, and unsetMachine().
|
virtual |
Destructor.
Definition at line 100 of file OperationTriggeredFormat.cc.
References operands_, and unsetMachine().
void TTAMachine::OperationTriggeredFormat::addOperand | ( | OperationTriggeredOperand & | operand | ) |
Definition at line 156 of file OperationTriggeredFormat.cc.
References operands_.
Referenced by TTAMachine::OperationTriggeredOperand::OperationTriggeredOperand().
void TTAMachine::OperationTriggeredFormat::addOperation | ( | const std::string & | op | ) |
Definition at line 113 of file OperationTriggeredFormat.cc.
References operations_.
bool TTAMachine::OperationTriggeredFormat::hasOperation | ( | const std::string & | opName | ) | const |
|
virtual |
Loads the name of the component from the given ObjectState instance.
state | The ObjectState instance. |
ObjectStateLoadingException | If the machine already contains same type of component with the same name. |
Reimplemented from TTAMachine::Component.
Definition at line 190 of file OperationTriggeredFormat.cc.
References ObjectState::child(), ObjectState::childCount(), Exception::errorMessage(), TTAMachine::Component::loadState(), ObjectState::name(), operands_, operations_, OSKEY_OPERATION, OSNAME_FORMAT, TTAMachine::OperationTriggeredOperand::OSNAME_OPERAND, and ObjectState::stringValue().
Referenced by OperationTriggeredFormat().
std::vector< OperationTriggeredOperand * > TTAMachine::OperationTriggeredFormat::operands | ( | ) | const |
Definition at line 151 of file OperationTriggeredFormat.cc.
References operands_.
std::string TTAMachine::OperationTriggeredFormat::operation | ( | int | index | ) | const |
Definition at line 132 of file OperationTriggeredFormat.cc.
References __func__, operationCount(), and operations_.
Referenced by OTAFormatListDialog::updateOperationList().
int TTAMachine::OperationTriggeredFormat::operationCount | ( | ) | const |
Definition at line 127 of file OperationTriggeredFormat.cc.
References operations_.
Referenced by operation(), and OTAFormatListDialog::updateOperationList().
std::vector< std::string > TTAMachine::OperationTriggeredFormat::operations | ( | ) | const |
Definition at line 108 of file OperationTriggeredFormat.cc.
References operations_.
Referenced by BEMGenerator::addRiscvFormat().
void TTAMachine::OperationTriggeredFormat::removeOperation | ( | const std::string & | op | ) |
|
virtual |
Saves the state of the operation code encoding to an ObjectState tree.
Reimplemented from TTAMachine::Component.
Definition at line 226 of file OperationTriggeredFormat.cc.
References ObjectState::addChild(), operands_, operations_, OSKEY_OPERATION, OSNAME_FORMAT, TTAMachine::Component::saveState(), ObjectState::setName(), and ObjectState::setValue().
|
virtual |
Adds the OperationTriggeredFormat to the given machine.
machine | Machine to which the OperationTriggeredFormat Format is added. |
ComponentAlreadyExists | If there already is another OperationTriggeredFormat Format by the same name or another empty OperationTriggeredFormat Format in the given machine. |
Implements TTAMachine::Component.
Definition at line 170 of file OperationTriggeredFormat.cc.
References TTAMachine::Machine::addOperationTriggeredFormat(), TTAMachine::Component::internalSetMachine(), and TTAMachine::Component::machine().
Referenced by OperationTriggeredFormat().
|
virtual |
Removes the OperationTriggeredFormat Format from its machine.
The OperationTriggeredFormat Format is also deleted because it cannot be alone. It must be registered to a machine.
Implements TTAMachine::Component.
Definition at line 182 of file OperationTriggeredFormat.cc.
References assert, TTAMachine::Machine::deleteOperationTriggeredFormat(), TTAMachine::Component::internalUnsetMachine(), and TTAMachine::Component::machine().
Referenced by OperationTriggeredFormat(), and ~OperationTriggeredFormat().
|
private |
Definition at line 79 of file OperationTriggeredFormat.hh.
Referenced by addOperand(), loadState(), operands(), saveState(), and ~OperationTriggeredFormat().
|
private |
Definition at line 78 of file OperationTriggeredFormat.hh.
Referenced by addOperation(), hasOperation(), loadState(), operation(), operationCount(), operations(), removeOperation(), and saveState().
|
static |
Definition at line 73 of file OperationTriggeredFormat.hh.
Referenced by loadState(), and saveState().
|
static |
Definition at line 72 of file OperationTriggeredFormat.hh.
Referenced by loadState(), TTAMachine::Machine::loadState(), and saveState().