OpenASIP
2.0
|
#include <BEMSerializer.hh>
Public Member Functions | |
BEMSerializer () | |
virtual | ~BEMSerializer () |
virtual ObjectState * | readState () |
virtual void | writeState (const ObjectState *state) |
BinaryEncoding * | readBinaryEncoding () |
void | writeBinaryEncoding (const BinaryEncoding &bem) |
Public Member Functions inherited from XMLSerializer | |
XMLSerializer () | |
virtual | ~XMLSerializer () |
void | setSourceFile (const std::string &fileName) |
void | setSourceString (const std::string &source) |
void | setDestinationFile (const std::string &fileName) |
void | setDestinationString (std::string &destination) |
void | setSchemaFile (const std::string &fileName) |
void | setUseSchema (bool useSchema) |
void | setXMLNamespace (std::string nsUri) |
Public Member Functions inherited from TCETools::Serializer | |
virtual | ~Serializer () |
Additional Inherited Members | |
Protected Member Functions inherited from XMLSerializer | |
std::string | sourceFile () const |
BEMSerializer reads and writes BEM (Binary Encoding Map) files.
Definition at line 43 of file BEMSerializer.hh.
BEMSerializer::BEMSerializer | ( | ) |
The constructor.
Definition at line 164 of file BEMSerializer.cc.
References BEM_SCHEMA_FILE, Environment::schemaDirPath(), XMLSerializer::setSchemaFile(), and XMLSerializer::setUseSchema().
|
virtual |
|
staticprivate |
Converts the ObjectState tree that represent the BEM object model to an ObjectState tree that represents the BEM file format.
omState | ObjectState tree that represents BEM object model (returned by BinaryEncoding::saveState()). |
Definition at line 327 of file BEMSerializer.cc.
References ObjectState::addChild(), ADF_ENCODING, BEM_VERSION_STR, ObjectState::child(), ObjectState::childCount(), immediateSlotToFile(), longImmDstRegisterFieldToFile(), longImmTagToFile(), moveSlotToFile(), ObjectState::name(), ImmediateControlField::OSNAME_IMM_CONTROL_FIELD, ImmediateSlotField::OSNAME_IMMEDIATE_SLOT_FIELD, InstructionFormat::OSNAME_INSTRUCTION_FORMAT, LImmDstRegisterField::OSNAME_LIMM_DST_REGISTER_FIELD, MoveSlot::OSNAME_MOVE_SLOT, SocketCodeTable::OSNAME_SOCKET_CODE_TABLE, BinaryEncoding::OSNAME_TEMPLATE_EXTRA_BITS, REQUIRED_VERSION, ObjectState::setAttribute(), and socketCodeTableToFile().
Referenced by writeState().
|
staticprivate |
Converts the given ObjectState tree that represents a BEM file to an ObjectState tree that can be loaded by BinaryEncoding.
fileState | ObjectState tree that represents a BEM file. |
Definition at line 287 of file BEMSerializer.cc.
References ObjectState::addChild(), assert, ObjectState::child(), ObjectState::childCount(), IMM_REG_FIELD, IMMEDIATE_SLOT, immediateSlotToOM(), INSTRUCTION_FORMAT, LONG_IMMEDIATE_TAG, longImmDstRegFieldToOM(), longImmTagToOM(), moveSlotToOM(), ObjectState::name(), BinaryEncoding::OSNAME_BEM, BinaryEncoding::OSNAME_TEMPLATE_EXTRA_BITS, SLOT, SOCKET_CODE_TABLE, and socketCodeTableToOM().
Referenced by readState().
|
staticprivate |
Recursively convert all encodings with zero encodings to have one more extra bit.
Definition at line 214 of file BEMSerializer.cc.
References ObjectState::child(), ObjectState::childByName(), ObjectState::childCount(), EXTRA_BITS, FU_PORT_CODE, FU_PORT_CODE_ENCODING, ObjectState::hasAttribute(), ObjectState::hasChild(), ObjectState::intAttribute(), ObjectState::intValue(), MAP, ObjectState::name(), ObjectState::setAttribute(), and ObjectState::setValue().
Referenced by readState().
|
staticprivate |
Converts the given ObjectState tree that represents a destination field in object model to BEM file format.
dFieldState | The ObjectState tree. |
Definition at line 784 of file BEMSerializer.cc.
References ObjectState::setName(), SLOT_DESTINATION, and slotFieldToFile().
Referenced by moveSlotToFile().
|
staticprivate |
Converts the given ObjectState tree that represents a destination element in BEM file to an ObjectState tree that can be loaded by DestinationField.
fileDestination | An ObjectState tree that represents a destination element in a BEM file. |
Definition at line 1222 of file BEMSerializer.cc.
References DestinationField::OSNAME_DESTINATION_FIELD, ObjectState::setName(), and slotFieldToOM().
Referenced by moveSlotToOM().
|
staticprivate |
Converts the given ObjectState tree that represents a guard field in object model to BEM file format.
gFieldState | The ObjectState tree. |
Definition at line 608 of file BEMSerializer.cc.
References ObjectState::addChild(), ALWAYS_FALSE_GUARD_CODE, ALWAYS_TRUE_GUARD_CODE, ObjectState::boolAttribute(), ObjectState::child(), ObjectState::childCount(), FALSE, ObjectState::name(), GuardEncoding::OSKEY_ENCODING, InstructionField::OSKEY_EXTRA_BITS, FUGuardEncoding::OSKEY_FU_NAME, GuardEncoding::OSKEY_INVERTED, FUGuardEncoding::OSKEY_PORT_NAME, InstructionField::OSKEY_POSITION, GPRGuardEncoding::OSKEY_REGISTER_INDEX, GPRGuardEncoding::OSKEY_RF_NAME, FUGuardEncoding::OSNAME_FU_GUARD_ENCODING, GPRGuardEncoding::OSNAME_GPR_GUARD_ENCODING, UnconditionalGuardEncoding::OSNAME_UNCONDITIONAL_GUARD_ENCODING, PORT_GUARD_CODE, PORT_GUARD_CODE_FU, PORT_GUARD_CODE_INVERTED, PORT_GUARD_CODE_PORT, REG_GUARD_CODE, REG_GUARD_CODE_INDEX, REG_GUARD_CODE_INVERTED, REG_GUARD_CODE_RF, ObjectState::setAttribute(), ObjectState::setValue(), SLOT_GUARD, SLOT_GUARD_EXTRA_BITS, SLOT_GUARD_POSITION, ObjectState::stringAttribute(), and TRUE.
Referenced by moveSlotToFile().
|
staticprivate |
Converts the given ObjectState tree that represents a guard element of BEM file to a new ObjectState tree that can be loaded by GuardField.
fileGuard | An ObjectState tree that represents a guard element of BEM file. |
Definition at line 1076 of file BEMSerializer.cc.
References ObjectState::addChild(), ALWAYS_FALSE_GUARD_CODE, ALWAYS_TRUE_GUARD_CODE, assert, ObjectState::child(), ObjectState::childByName(), ObjectState::childCount(), FALSE, ObjectState::intAttribute(), ObjectState::name(), GuardEncoding::OSKEY_ENCODING, InstructionField::OSKEY_EXTRA_BITS, FUGuardEncoding::OSKEY_FU_NAME, GuardEncoding::OSKEY_INVERTED, FUGuardEncoding::OSKEY_PORT_NAME, InstructionField::OSKEY_POSITION, GPRGuardEncoding::OSKEY_REGISTER_INDEX, GPRGuardEncoding::OSKEY_RF_NAME, FUGuardEncoding::OSNAME_FU_GUARD_ENCODING, GPRGuardEncoding::OSNAME_GPR_GUARD_ENCODING, GuardField::OSNAME_GUARD_FIELD, PORT_GUARD_CODE, PORT_GUARD_CODE_FU, PORT_GUARD_CODE_INVERTED, PORT_GUARD_CODE_PORT, REG_GUARD_CODE, REG_GUARD_CODE_INDEX, REG_GUARD_CODE_INVERTED, REG_GUARD_CODE_RF, ObjectState::setAttribute(), SLOT_GUARD_EXTRA_BITS, SLOT_GUARD_POSITION, ObjectState::stringAttribute(), ObjectState::stringValue(), and TRUE.
Referenced by moveSlotToOM().
|
staticprivate |
Converts the given ObjectState instance that represents an ImmediateSlotField instance to BEM file format.
slotState | The ObjectState instance that represents an ImmediateSlotField instance. |
Definition at line 870 of file BEMSerializer.cc.
References ObjectState::addChild(), IMMEDIATE_SLOT, IMMEDIATE_SLOT_NAME, IMMEDIATE_SLOT_POS, IMMEDIATE_SLOT_WIDTH, ImmediateSlotField::OSKEY_NAME, InstructionField::OSKEY_POSITION, ImmediateSlotField::OSKEY_WIDTH, ObjectState::setAttribute(), ObjectState::setValue(), and ObjectState::stringAttribute().
Referenced by convertToFileFormat().
|
staticprivate |
Converts the given ObjectState tree that represents immediate-slot element of BEM file to an ObjectState instance that can be loaded by ImmediateSlotField instance.
fileSlot | ObjectState tree that represents immediate-slot element of BEM file. |
Definition at line 1312 of file BEMSerializer.cc.
References ObjectState::childByName(), IMMEDIATE_SLOT_NAME, IMMEDIATE_SLOT_POS, IMMEDIATE_SLOT_WIDTH, InstructionField::OSKEY_EXTRA_BITS, ImmediateSlotField::OSKEY_NAME, InstructionField::OSKEY_POSITION, ImmediateSlotField::OSKEY_WIDTH, ImmediateSlotField::OSNAME_IMMEDIATE_SLOT_FIELD, ObjectState::setAttribute(), ObjectState::stringAttribute(), and ObjectState::stringValue().
Referenced by convertToOMFormat().
|
staticprivate |
Converts the given ObjectState tree that represents a long immediate destination register field in BEM file to an ObjectState tree that can be loaded by LImmDstRegisterField instance.
fileField | The ObjectState tree that represents long immediate destination register field in BEM file. |
Definition at line 1337 of file BEMSerializer.cc.
References ObjectState::addChild(), ObjectState::child(), ObjectState::childByName(), ObjectState::childCount(), IMM_REG_FIELD_ITEMP, IMM_REG_FIELD_ITEMP_NAME, IMM_REG_FIELD_POS, IMM_REG_FIELD_WIDTH, ObjectState::name(), LImmDstRegisterField::OSKEY_DST_IU, InstructionField::OSKEY_EXTRA_BITS, LImmDstRegisterField::OSKEY_ITEMP, InstructionField::OSKEY_POSITION, LImmDstRegisterField::OSKEY_WIDTH, LImmDstRegisterField::OSNAME_IU_DESTINATION, LImmDstRegisterField::OSNAME_LIMM_DST_REGISTER_FIELD, ObjectState::setAttribute(), ObjectState::stringAttribute(), and ObjectState::stringValue().
Referenced by convertToOMFormat().
|
staticprivate |
Converts the given ObjectState tree that represent a long immediate destination register field in BEM object model to BEM file format.
omState | The ObjectState tree. |
Definition at line 895 of file BEMSerializer.cc.
References ObjectState::addChild(), assert, ObjectState::child(), ObjectState::childCount(), IMM_REG_FIELD, IMM_REG_FIELD_ITEMP, IMM_REG_FIELD_ITEMP_NAME, IMM_REG_FIELD_ITEMP_REG_INDEX, IMM_REG_FIELD_POS, IMM_REG_FIELD_WIDTH, ObjectState::name(), LImmDstRegisterField::OSKEY_DST_IU, LImmDstRegisterField::OSKEY_ITEMP, InstructionField::OSKEY_POSITION, LImmDstRegisterField::OSKEY_WIDTH, LImmDstRegisterField::OSNAME_IU_DESTINATION, ObjectState::setAttribute(), ObjectState::setValue(), and ObjectState::stringAttribute().
Referenced by convertToFileFormat().
|
staticprivate |
Converts the given ObjectState tree that represents immediate control field in object model format to BEM file file format.
immTag | The ObjectState tree. |
Definition at line 524 of file BEMSerializer.cc.
References ObjectState::addChild(), assert, ObjectState::child(), ObjectState::childCount(), LIMM_TAG_EXTRA_BITS, LIMM_TAG_MAP, LIMM_TAG_MAP_NAME, LIMM_TAG_POSITION, LONG_IMMEDIATE_TAG, ObjectState::name(), ImmediateControlField::OSKEY_ENCODING, InstructionField::OSKEY_EXTRA_BITS, InstructionField::OSKEY_POSITION, ImmediateControlField::OSKEY_TEMPLATE_NAME, ImmediateControlField::OSNAME_TEMPLATE_MAP, ObjectState::setAttribute(), ObjectState::setValue(), and ObjectState::stringAttribute().
Referenced by convertToFileFormat().
|
staticprivate |
Converts the given ObjectState tree that represents a long-immediate-tag element of BEM file to ObjectState tree that can be loaded by ImmediateControlField.
fileTag | An ObjectState tree that represents a long-immediate-tag element. |
Definition at line 995 of file BEMSerializer.cc.
References ObjectState::addChild(), ObjectState::child(), ObjectState::childByName(), ObjectState::childCount(), LIMM_TAG_EXTRA_BITS, LIMM_TAG_MAP, LIMM_TAG_MAP_NAME, LIMM_TAG_POSITION, ObjectState::name(), ImmediateControlField::OSKEY_ENCODING, InstructionField::OSKEY_EXTRA_BITS, InstructionField::OSKEY_POSITION, ImmediateControlField::OSKEY_TEMPLATE_NAME, ImmediateControlField::OSNAME_IMM_CONTROL_FIELD, ImmediateControlField::OSNAME_TEMPLATE_MAP, ObjectState::setAttribute(), ObjectState::stringAttribute(), and ObjectState::stringValue().
Referenced by convertToOMFormat().
|
staticprivate |
Converts the given ObjectState tree that represents a move slot in object model format to BEM file format.
slotState | The ObjectState tree. |
Definition at line 562 of file BEMSerializer.cc.
References ObjectState::addChild(), ObjectState::childByName(), destinationFieldToFile(), guardFieldToFile(), ObjectState::hasChild(), MoveSlot::OSKEY_BUS_NAME, InstructionField::OSKEY_EXTRA_BITS, InstructionField::OSKEY_POSITION, DestinationField::OSNAME_DESTINATION_FIELD, GuardField::OSNAME_GUARD_FIELD, SourceField::OSNAME_SOURCE_FIELD, ObjectState::setAttribute(), ObjectState::setValue(), SLOT, SLOT_EXTRA_BITS, SLOT_NAME, SLOT_POSITION, sourceFieldToFile(), and ObjectState::stringAttribute().
Referenced by convertToFileFormat().
|
staticprivate |
Converts the given ObjectState tree that represents a slot element of BEM file to ObjectState tree that can be loaded by MoveSlot.
fileSlot | The ObjectState tree that represents a slot element. |
Definition at line 1032 of file BEMSerializer.cc.
References ObjectState::addChild(), ObjectState::childByName(), destinationFieldToOM(), guardFieldToOM(), ObjectState::hasChild(), MoveSlot::OSKEY_BUS_NAME, InstructionField::OSKEY_EXTRA_BITS, InstructionField::OSKEY_POSITION, MoveSlot::OSNAME_MOVE_SLOT, ObjectState::setAttribute(), SLOT_DESTINATION, SLOT_EXTRA_BITS, SLOT_GUARD, SLOT_NAME, SLOT_POSITION, SLOT_SOURCE, sourceFieldToOM(), ObjectState::stringAttribute(), and ObjectState::stringValue().
Referenced by convertToOMFormat().
BinaryEncoding * BEMSerializer::readBinaryEncoding | ( | ) |
Reads the BEM file and creates a BinaryEncoding instance from it.
Definition at line 258 of file BEMSerializer.cc.
References readState().
Referenced by loadBEM(), ProGe::ProGeUI::loadBinaryEncoding(), ProGe::ProGeUI::loadProcessorConfiguration(), main(), and GenerateProcessorDialog::onBrowseBEMLoad().
|
staticprivate |
Reads rf-port-code or iu-port-code element from an ObjectState tree that represents BEM file and adds the data to the given ObjectState instance to make it loadable by RFPortCode or IUPortCode.
filePortCode | ObjectState tree representing rf-port-code or iu-port-code element of BEM file. |
omPortCode | The ObjectState instance to which the data is added. |
Definition at line 1377 of file BEMSerializer.cc.
References assert, ObjectState::childByName(), ObjectState::hasChild(), IU_PORT_CODE, IU_PORT_CODE_IU, ObjectState::name(), PortCode::OSKEY_ENCODING, PortCode::OSKEY_EXTRA_BITS, PortCode::OSKEY_INDEX_WIDTH, PortCode::OSKEY_UNIT_NAME, RF_PORT_CODE, RF_PORT_CODE_ENCODING, RF_PORT_CODE_EXTRA_BITS, RF_PORT_CODE_INDEX_WIDTH, RF_PORT_CODE_RF, ObjectState::setAttribute(), ObjectState::stringAttribute(), and ObjectState::stringValue().
Referenced by socketCodeTableToOM().
|
virtual |
Reads the BEM file and returns an ObjectState tree that can be loaded by BinaryEncoding.
SerializerException | If an error occurs while reading the BEM file. |
Reimplemented from XMLSerializer.
Definition at line 186 of file BEMSerializer.cc.
References BEM_VERSION_STR, convertToOMFormat(), convertZeroEncExtraBits(), ObjectState::doubleAttribute(), ObjectState::hasAttribute(), XMLSerializer::readState(), REQUIRED_VERSION, ObjectState::stringAttribute(), and THROW_EXCEPTION.
Referenced by readBinaryEncoding().
|
staticprivate |
Converts the given ObjectState tree that represents either source or destination in BEM object model to BEM file format.
sFieldState | The ObjectState tree. |
Definition at line 798 of file BEMSerializer.cc.
References ObjectState::addChild(), ObjectState::child(), ObjectState::childByName(), ObjectState::childCount(), ObjectState::hasAttribute(), ObjectState::hasChild(), ID_POS_LEFT, ID_POS_RIGHT, ObjectState::intAttribute(), BinaryEncoding::LEFT, ObjectState::name(), SlotField::OSKEY_COMPONENT_ID_POSITION, Encoding::OSKEY_ENCODING, Encoding::OSKEY_EXTRA_BITS, InstructionField::OSKEY_EXTRA_BITS, InstructionField::OSKEY_POSITION, SocketEncoding::OSKEY_SC_TABLE, SocketEncoding::OSKEY_SOCKET_NAME, NOPEncoding::OSNAME_NOP_ENCODING, SocketEncoding::OSNAME_SOCKET_ENCODING, ObjectState::setAttribute(), ObjectState::setValue(), SLOT_SOURCE, SOCKET, SOCKET_MAP, SOCKET_MAP_CODES, SOCKET_MAP_EXTRA_BITS, SOCKET_NAME, SRC_DST_EXTRA_BITS, SRC_DST_ID_POS, SRC_DST_NO_OPERATION, SRC_DST_NO_OPERATION_MAP, SRC_DST_NO_OPERATION_MAP_EXTRA_BITS, SRC_DST_POSITION, and ObjectState::stringAttribute().
Referenced by destinationFieldToFile(), and sourceFieldToFile().
|
staticprivate |
Converts the given ObjectState tree that represents either source or destination element of BEM file to an ObjectState tree that can be loaded by SlotField.
fileSlot | An ObjectState tree representing source or destination field. |
Definition at line 1239 of file BEMSerializer.cc.
References ObjectState::addChild(), assert, ObjectState::child(), ObjectState::childByName(), ObjectState::childCount(), ObjectState::hasAttribute(), ObjectState::hasChild(), ID_POS_LEFT, ID_POS_RIGHT, BinaryEncoding::LEFT, ObjectState::name(), SlotField::OSKEY_COMPONENT_ID_POSITION, Encoding::OSKEY_ENCODING, Encoding::OSKEY_EXTRA_BITS, InstructionField::OSKEY_EXTRA_BITS, InstructionField::OSKEY_POSITION, SocketEncoding::OSKEY_SC_TABLE, SocketEncoding::OSKEY_SOCKET_NAME, NOPEncoding::OSNAME_NOP_ENCODING, SlotField::OSNAME_SLOT_FIELD, SocketEncoding::OSNAME_SOCKET_ENCODING, BinaryEncoding::RIGHT, ObjectState::setAttribute(), SOCKET, SOCKET_MAP, SOCKET_MAP_CODES, SOCKET_MAP_EXTRA_BITS, SOCKET_NAME, SRC_DST_EXTRA_BITS, SRC_DST_ID_POS, SRC_DST_NO_OPERATION, SRC_DST_NO_OPERATION_MAP_EXTRA_BITS, SRC_DST_POSITION, ObjectState::stringAttribute(), and ObjectState::stringValue().
Referenced by destinationFieldToOM(), and sourceFieldToOM().
|
staticprivate |
Converts the given ObjectState tree that represents a socket code table in the object model format to BEM file format.
Definition at line 404 of file BEMSerializer.cc.
References ObjectState::addChild(), ObjectState::child(), ObjectState::childCount(), FU_PORT_CODE, FU_PORT_CODE_ENCODING, FU_PORT_CODE_EXTRA_BITS, FU_PORT_CODE_FU, FU_PORT_CODE_OPERATION, FU_PORT_CODE_PORT, ObjectState::hasAttribute(), ObjectState::intAttribute(), IU_PORT_CODE, IU_PORT_CODE_IU, ObjectState::name(), PortCode::OSKEY_ENCODING, PortCode::OSKEY_EXTRA_BITS, SocketCodeTable::OSKEY_EXTRA_BITS, PortCode::OSKEY_INDEX_WIDTH, PortCode::OSKEY_MAX_INDEX, SocketCodeTable::OSKEY_NAME, FUPortCode::OSKEY_OPERATION_NAME, FUPortCode::OSKEY_PORT_NAME, PortCode::OSKEY_UNIT_NAME, FUPortCode::OSNAME_FU_PORT_CODE, IUPortCode::OSNAME_IU_PORT_CODE, RFPortCode::OSNAME_RF_PORT_CODE, RF_PORT_CODE, RF_PORT_CODE_ENCODING, RF_PORT_CODE_EXTRA_BITS, RF_PORT_CODE_INDEX_WIDTH, RF_PORT_CODE_MAX_INDEX, RF_PORT_CODE_RF, SC_TABLE_EXTRA_BITS, SC_TABLE_NAME, ObjectState::setAttribute(), ObjectState::setValue(), SOCKET_CODE_TABLE, and ObjectState::stringAttribute().
Referenced by convertToFileFormat().
|
staticprivate |
Converts the given ObjectState tree that represents a socket code table in BEM file to an ObjectState tree that can be loaded by SocketCodeTable.
scTable | The ObjectState tree. |
Definition at line 934 of file BEMSerializer.cc.
References ObjectState::addChild(), ObjectState::child(), ObjectState::childByName(), ObjectState::childCount(), FU_PORT_CODE, FU_PORT_CODE_ENCODING, FU_PORT_CODE_EXTRA_BITS, FU_PORT_CODE_FU, FU_PORT_CODE_OPERATION, FU_PORT_CODE_PORT, ObjectState::hasAttribute(), ObjectState::intValue(), IU_PORT_CODE, ObjectState::name(), PortCode::OSKEY_ENCODING, PortCode::OSKEY_EXTRA_BITS, SocketCodeTable::OSKEY_EXTRA_BITS, SocketCodeTable::OSKEY_NAME, FUPortCode::OSKEY_OPERATION_NAME, FUPortCode::OSKEY_PORT_NAME, PortCode::OSKEY_UNIT_NAME, FUPortCode::OSNAME_FU_PORT_CODE, IUPortCode::OSNAME_IU_PORT_CODE, RFPortCode::OSNAME_RF_PORT_CODE, SocketCodeTable::OSNAME_SOCKET_CODE_TABLE, readRegisterFilePortCode(), RF_PORT_CODE, SC_TABLE_EXTRA_BITS, SC_TABLE_NAME, ObjectState::setAttribute(), ObjectState::stringAttribute(), and ObjectState::stringValue().
Referenced by convertToOMFormat().
|
staticprivate |
Converts the given ObjectState tree that represents a source field in object model to BEM file format.
sFieldState | The ObjectState tree. |
Definition at line 704 of file BEMSerializer.cc.
References ObjectState::addChild(), ObjectState::child(), ObjectState::childByName(), ObjectState::childCount(), ObjectState::hasChild(), ObjectState::name(), BridgeEncoding::OSKEY_BRIDGE_NAME, Encoding::OSKEY_ENCODING, Encoding::OSKEY_EXTRA_BITS, ImmediateEncoding::OSKEY_IMM_WIDTH, BridgeEncoding::OSNAME_BRIDGE_ENCODING, ImmediateEncoding::OSNAME_IMM_ENCODING, ObjectState::removeChild(), ObjectState::setAttribute(), ObjectState::setName(), ObjectState::setValue(), SLOT_SOURCE, slotFieldToFile(), SOCKET, SOURCE_BRIDGE, SOURCE_BRIDGE_MAP, SOURCE_BRIDGE_MAP_EXTRA_BITS, SOURCE_BRIDGE_NAME, SOURCE_IMMEDIATE, SOURCE_IMMEDIATE_MAP, SOURCE_IMMEDIATE_MAP_EXTRA_BITS, SOURCE_IMMEDIATE_WIDTH, SRC_DST_NO_OPERATION, and ObjectState::stringAttribute().
Referenced by moveSlotToFile().
|
staticprivate |
Converts the given ObjectState tree that represents a source element in BEM file to an ObjectState tree that can be loaded by SourceField.
fileSource | An ObjectState tree that represents a source element in a BEM file. |
Definition at line 1167 of file BEMSerializer.cc.
References ObjectState::addChild(), ObjectState::child(), ObjectState::childByName(), ObjectState::childCount(), ObjectState::hasChild(), ObjectState::name(), BridgeEncoding::OSKEY_BRIDGE_NAME, Encoding::OSKEY_ENCODING, Encoding::OSKEY_EXTRA_BITS, ImmediateEncoding::OSKEY_IMM_WIDTH, BridgeEncoding::OSNAME_BRIDGE_ENCODING, ImmediateEncoding::OSNAME_IMM_ENCODING, SourceField::OSNAME_SOURCE_FIELD, ObjectState::setAttribute(), ObjectState::setName(), slotFieldToOM(), SOURCE_BRIDGE, SOURCE_BRIDGE_MAP, SOURCE_BRIDGE_MAP_EXTRA_BITS, SOURCE_BRIDGE_NAME, SOURCE_IMMEDIATE, SOURCE_IMMEDIATE_MAP_EXTRA_BITS, SOURCE_IMMEDIATE_WIDTH, ObjectState::stringAttribute(), and ObjectState::stringValue().
Referenced by moveSlotToOM().
void BEMSerializer::writeBinaryEncoding | ( | const BinaryEncoding & | bem | ) |
Writes the given binary encoding to a BEM file.
bem | The binary encoding. |
SerializerException | If the destination file cannot be written. |
Definition at line 272 of file BEMSerializer.cc.
References BinaryEncoding::saveState(), and writeState().
Referenced by main(), and GenerateProcessorDialog::onOK().
|
virtual |
Writes the given ObjectState tree that represents a BEM object model to a BEM file.
state | ObjectState tree obtained by calling BinaryEncoding::saveState(). |
SerializerException | If the destination file cannot be written. |
Reimplemented from XMLSerializer.
Definition at line 246 of file BEMSerializer.cc.
References convertToFileFormat(), and XMLSerializer::writeState().
Referenced by writeBinaryEncoding().