|
OpenASIP 2.2
|
#include <BridgeEncoding.hh>


Public Member Functions | |
| BridgeEncoding (const std::string &name, unsigned int encoding, unsigned int extraBits, SourceField &parent) | |
| BridgeEncoding (const ObjectState *state, SourceField &parent) | |
| virtual | ~BridgeEncoding () |
| SourceField * | parent () const |
| std::string | bridgeName () const |
| virtual int | bitPosition () const |
| virtual ObjectState * | saveState () const |
Public Member Functions inherited from Encoding | |
| virtual | ~Encoding () |
| InstructionField * | parent () const |
| unsigned int | encoding () const |
| unsigned int | extraBits () const |
| virtual int | width () const |
Static Public Attributes | |
| static const std::string | OSNAME_BRIDGE_ENCODING = "bridge_encoding" |
| ObjectState name for bridge encoding. | |
| static const std::string | OSKEY_BRIDGE_NAME = "bridge_name" |
| ObjectState attribute key for the name of the bridge. | |
Static Public Attributes inherited from Encoding | |
| static const std::string | OSNAME_ENCODING = "encoding" |
| ObjectState name for Encoding class. | |
| static const std::string | OSKEY_ENCODING = "encoding" |
| ObjectState attribute key for the encoding. | |
| static const std::string | OSKEY_EXTRA_BITS = "extra_bits" |
| ObjectState attribute key for the number of extra bits. | |
Private Attributes | |
| std::string | bridge_ |
| Name of the bridge. | |
Additional Inherited Members | |
Protected Member Functions inherited from Encoding | |
| Encoding (unsigned int encoding, unsigned int extraBits, InstructionField *parent) | |
| Encoding (const ObjectState *state, InstructionField *parent) | |
| void | setParent (InstructionField *parent) |
| void | setEncoding (unsigned int encoding, unsigned int extraBits) |
Class BridgeEncoding maps a bridge to a binary encoding.
Definition at line 47 of file BridgeEncoding.hh.
| BridgeEncoding::BridgeEncoding | ( | const std::string & | name, |
| unsigned int | encoding, | ||
| unsigned int | extraBits, | ||
| SourceField & | parent | ||
| ) |
The constructor.
Creates an encoding for the given bridge and registers it into the given source field.
| name | Name of the bridge. |
| encoding | The encoding. |
| extraBits | The number of extra (zero) bits in the encoding. |
| parent | The parent source field. |
| ObjectAlreadyExists | If the parent source field has an encoding for this bridge already or if the encoding is ambiguous with some other encoding. |
Definition at line 60 of file BridgeEncoding.cc.
References SourceField::addBridgeEncoding(), parent(), and Encoding::setParent().

| BridgeEncoding::BridgeEncoding | ( | const ObjectState * | state, |
| SourceField & | parent | ||
| ) |
The constructor.
Loads the state of the object from the given ObjectState instance.
| state | The ObjectState instance. |
| parent | The parent source field. |
| ObjectStateLoadingException | If an error occurs while loading the state. |
| ObjectAlreadyExists | If the parent source field has an encoding for this bridge already or if the encoding is ambiguous with some other encoding. |
Definition at line 81 of file BridgeEncoding.cc.
References SourceField::addBridgeEncoding(), bridge_, Exception::errorMessage(), ObjectState::name(), OSKEY_BRIDGE_NAME, OSNAME_BRIDGE_ENCODING, parent(), Encoding::setParent(), and ObjectState::stringAttribute().

|
virtual |
The destructor.
Definition at line 103 of file BridgeEncoding.cc.
References parent(), SourceField::removeBridgeEncoding(), and Encoding::setParent().

|
virtual |
Returns the position of the bridge encoding within the source field.
Implements Encoding.
Definition at line 145 of file BridgeEncoding.cc.
References InstructionField::extraBits(), parent(), BinaryEncoding::RIGHT, Encoding::width(), and SourceField::width().

| std::string BridgeEncoding::bridgeName | ( | ) | const |
Returns the name of the bridge.
Definition at line 134 of file BridgeEncoding.cc.
References bridge_.
Referenced by SourceField::addBridgeEncoding(), SourceField::bridgeEncoding(), SourceField::hasBridgeEncoding(), printSourceFieldEncodings(), and saveState().
| SourceField * BridgeEncoding::parent | ( | ) | const |
Returns the parent source field.
Definition at line 116 of file BridgeEncoding.cc.
References assert, parent(), and Encoding::parent().
Referenced by SourceField::addBridgeEncoding(), bitPosition(), BridgeEncoding(), BridgeEncoding(), parent(), SourceField::removeBridgeEncoding(), and ~BridgeEncoding().

|
virtual |
Saves the state of the object to an ObjectState instance.
Reimplemented from Encoding.
Definition at line 160 of file BridgeEncoding.cc.
References bridgeName(), OSKEY_BRIDGE_NAME, OSNAME_BRIDGE_ENCODING, Encoding::saveState(), ObjectState::setAttribute(), and ObjectState::setName().
Referenced by SourceField::saveState().

|
private |
Name of the bridge.
Definition at line 68 of file BridgeEncoding.hh.
Referenced by BridgeEncoding(), and bridgeName().
|
static |
ObjectState attribute key for the name of the bridge.
Definition at line 64 of file BridgeEncoding.hh.
Referenced by BridgeEncoding(), saveState(), BEMSerializer::sourceFieldToFile(), and BEMSerializer::sourceFieldToOM().
|
static |
ObjectState name for bridge encoding.
Definition at line 62 of file BridgeEncoding.hh.
Referenced by BridgeEncoding(), SourceField::loadState(), saveState(), BEMSerializer::sourceFieldToFile(), and BEMSerializer::sourceFieldToOM().