OpenASIP
2.0
|
#include <SectionSizeReplacer.hh>
Public Member Functions | |
SectionSizeReplacer (const SafePointable *obj) | |
virtual | ~SectionSizeReplacer () |
Public Member Functions inherited from TPEF::ValueReplacer | |
void | resolve () |
Static Public Member Functions | |
static void | setSize (const SafePointable *obj, Word size) |
static void | clear () |
Static Public Member Functions inherited from TPEF::ValueReplacer | |
static void | finalize () |
static void | initialize (BinaryStream &stream) |
Protected Member Functions | |
virtual bool | tryToReplace () |
virtual ValueReplacer * | clone () |
Protected Member Functions inherited from TPEF::ValueReplacer | |
ValueReplacer (const SafePointable *obj) | |
ValueReplacer (const ValueReplacer &replacer) | |
virtual | ~ValueReplacer () |
const SafePointable * | reference () const |
unsigned int | streamPosition () const |
Private Member Functions | |
SectionSizeReplacer (const SectionSizeReplacer &replacer) | |
SectionSizeReplacer | operator= (const SectionSizeReplacer &) |
Static Private Attributes | |
static std::map< const SafePointable *, Word > | sizeMap |
Contains sections sizes. More... | |
Additional Inherited Members | |
Static Protected Member Functions inherited from TPEF::ValueReplacer | |
static BinaryStream & | stream () |
Replaces object reference with size of object. Size for object must be stored with static setSize method of this class.
Definition at line 50 of file SectionSizeReplacer.hh.
TPEF::SectionSizeReplacer::SectionSizeReplacer | ( | const SafePointable * | obj | ) |
|
virtual |
|
private |
Copy constructor.
Definition at line 55 of file SectionSizeReplacer.cc.
|
static |
Clears all elements from size map.
Definition at line 109 of file SectionSizeReplacer.cc.
References sizeMap.
Referenced by TPEF::BinaryWriter::writeBinary().
|
protectedvirtual |
Creates dynamically allocated copy of replacer.
Implements TPEF::ValueReplacer.
Definition at line 89 of file SectionSizeReplacer.cc.
References SectionSizeReplacer().
|
private |
|
static |
Set's size for referred object.
obj | Objects which for size is stored. |
size | Size to store. |
Definition at line 100 of file SectionSizeReplacer.cc.
References assert, and sizeMap.
Referenced by TPEF::TPEFLineNumSectionWriter::actualWriteData(), TPEF::TPEFStringSectionWriter::actualWriteData(), TPEF::TPEFResourceSectionWriter::actualWriteData(), TPEF::TPEFASpaceSectionWriter::actualWriteData(), TPEF::TPEFRelocSectionWriter::actualWriteData(), TPEF::TPEFDebugSectionWriter::actualWriteData(), TPEF::TPEFCodeSectionWriter::actualWriteData(), TPEF::TPEFDataSectionWriter::actualWriteData(), TPEF::TPEFSymbolSectionWriter::actualWriteData(), TPEF::TPEFDebugSectionWriter::createKeys(), and TPEF::TPEFSymbolSectionWriter::createKeys().
|
protectedvirtual |
Tries to do replacement in to the stream.
Implements TPEF::ValueReplacer.
Definition at line 72 of file SectionSizeReplacer.cc.
References MapTools::containsKey(), TPEF::ValueReplacer::reference(), TPEF::BinaryStream::setWritePosition(), sizeMap, TPEF::ValueReplacer::stream(), TPEF::ValueReplacer::streamPosition(), and TPEF::BinaryStream::writeWord().
|
staticprivate |
Contains sections sizes.
Definition at line 68 of file SectionSizeReplacer.hh.
Referenced by clear(), setSize(), and tryToReplace().