OpenASIP  2.0
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Attributes | List of all members
TPEF::AOutDataSectionReader Class Reference

#include <AOutDataSectionReader.hh>

Inheritance diagram for TPEF::AOutDataSectionReader:
Inheritance graph
Collaboration diagram for TPEF::AOutDataSectionReader:
Collaboration graph

Public Member Functions

virtual ~AOutDataSectionReader ()
 
- Public Member Functions inherited from TPEF::AOutSectionReader
virtual ~AOutSectionReader ()
 
- Public Member Functions inherited from TPEF::SectionReader
virtual ~SectionReader ()
 

Protected Member Functions

 AOutDataSectionReader ()
 
virtual void readData (BinaryStream &stream, Section *section) const
 
virtual Section::SectionType type () const
 
- Protected Member Functions inherited from TPEF::AOutSectionReader
 AOutSectionReader ()
 
virtual BinaryReaderparent () const
 
- Protected Member Functions inherited from TPEF::SectionReader
 SectionReader ()
 
virtual void finalize (Section *section) const
 

Private Member Functions

 AOutDataSectionReader (const AOutDataSectionReader &)
 Copying not allowed. More...
 

Static Private Attributes

static AOutDataSectionReader proto_
 Prototype instance of AOutDataSectionReader to be registered to SectionReader. More...
 

Additional Inherited Members

- Public Types inherited from TPEF::SectionReader
typedef BinaryReader::Length Length
 
- Static Public Member Functions inherited from TPEF::SectionReader
static void readSection (BinaryStream &stream, Section *section, BinaryReader *reader)
 
static void finalizeBinary (Binary *binaryToFinalize, BinaryReader *reader)
 
- Static Protected Member Functions inherited from TPEF::SectionReader
static const SectionReaderfindSectionReader (const Section::SectionType type, const BinaryReader *bReader)
 
static void registerSectionReader (const SectionReader *sReader)
 

Detailed Description

Reads data section from a.out binary file.

Definition at line 49 of file AOutDataSectionReader.hh.

Constructor & Destructor Documentation

◆ ~AOutDataSectionReader()

TPEF::AOutDataSectionReader::~AOutDataSectionReader ( )
virtual

Destructor.

Definition at line 64 of file AOutDataSectionReader.cc.

64  {
65 }

◆ AOutDataSectionReader() [1/2]

TPEF::AOutDataSectionReader::AOutDataSectionReader ( )
protected

Constructor.

Registers itself to SectionReader.

Definition at line 57 of file AOutDataSectionReader.cc.

References TPEF::SectionReader::registerSectionReader().

Here is the call graph for this function:

◆ AOutDataSectionReader() [2/2]

TPEF::AOutDataSectionReader::AOutDataSectionReader ( const AOutDataSectionReader )
private

Copying not allowed.

Member Function Documentation

◆ readData()

void TPEF::AOutDataSectionReader::readData ( BinaryStream stream,
Section section 
) const
protectedvirtual

Reads data section of a.out binary file.

Parameters
streamStream to be read from.
sectionSection where the information is to be stored.
Exceptions
UnreachableStreamIf reading of section fails.
KeyAlreadyExistsKey was in use when trying to register object.
EndOfFileIf end of file were reached while it shouldn't.
OutOfRangeSome of read values were out of range.
WrongSubclassSome class couldn't do what it was asked for.
UnexpectedValueIf there was unexpected value when reading.

Implements TPEF::SectionReader.

Definition at line 90 of file AOutDataSectionReader.cc.

90  {
91  AOutReader* bReader = dynamic_cast<AOutReader*>(parent());
92  assert(bReader != NULL);
93 
94  DataSection* theDataSection = dynamic_cast<DataSection*>(section);
95  assert(theDataSection != NULL);
96 
97  for (SectionOffset i = 0;
98  i < bReader->header().sectionSizeData(); i++) {
99  theDataSection->addByte(stream.readByte());
100  }
101 }

References TPEF::DataSection::addByte(), assert, TPEF::AOutReader::header(), TPEF::AOutSectionReader::parent(), and TPEF::BinaryStream::readByte().

Here is the call graph for this function:

◆ type()

Section::SectionType TPEF::AOutDataSectionReader::type ( ) const
protectedvirtual

Returns the type of section it is meant to read.

Returns
The type of section it can read.

Implements TPEF::SectionReader.

Definition at line 73 of file AOutDataSectionReader.cc.

73  {
74  return Section::ST_DATA;
75 }

References TPEF::Section::ST_DATA.

Member Data Documentation

◆ proto_

AOutDataSectionReader TPEF::AOutDataSectionReader::proto_
staticprivate

Prototype instance of AOutDataSectionReader to be registered to SectionReader.

Definition at line 66 of file AOutDataSectionReader.hh.


The documentation for this class was generated from the following files:
assert
#define assert(condition)
Definition: Application.hh:86
TPEF::Section::ST_DATA
@ ST_DATA
Initialized data section.
Definition: Section.hh:80
TPEF::AOutSectionReader::parent
virtual BinaryReader * parent() const
Definition: AOutSectionReader.cc:57
TPEF::SectionReader::registerSectionReader
static void registerSectionReader(const SectionReader *sReader)
Definition: SectionReader.cc:145
TPEF::AOutSectionReader::AOutSectionReader
AOutSectionReader()
Definition: AOutSectionReader.cc:41
TPEF::SectionOffset
Word SectionOffset
Type for storing offsets relative to a given base offset value.
Definition: TPEFBaseType.hh:49