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

#include <TPEFUDataSectionReader.hh>

Inheritance diagram for TPEF::TPEFUDataSectionReader:
Inheritance graph
Collaboration diagram for TPEF::TPEFUDataSectionReader:
Collaboration graph

Protected Member Functions

 TPEFUDataSectionReader ()
 
virtual ~TPEFUDataSectionReader ()
 
virtual void readData (BinaryStream &stream, Section *section) const
 
virtual Section::SectionType type () const
 
- Protected Member Functions inherited from TPEF::TPEFSectionReader
 TPEFSectionReader ()
 
virtual BinaryReaderparent () const
 
virtual void readInfo (BinaryStream &stream, Section *sect) const
 
- Protected Member Functions inherited from TPEF::SectionReader
 SectionReader ()
 
virtual void finalize (Section *section) const
 

Private Member Functions

 TPEFUDataSectionReader (const TPEFUDataSectionReader &)
 Copying not allowed. More...
 
TPEFUDataSectionReaderoperator= (TPEFUDataSectionReader &)
 Assignment not allowed. More...
 

Static Private Attributes

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

Additional Inherited Members

- Public Types inherited from TPEF::SectionReader
typedef BinaryReader::Length Length
 
- Public Member Functions inherited from TPEF::TPEFSectionReader
virtual ~TPEFSectionReader ()
 
- Public Member Functions inherited from TPEF::SectionReader
virtual ~SectionReader ()
 
- 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::TPEFSectionReader
static const Headerheader ()
 
- 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 uninitialized data section from TPEF binary file.

Definition at line 46 of file TPEFUDataSectionReader.hh.

Constructor & Destructor Documentation

◆ TPEFUDataSectionReader() [1/2]

TPEF::TPEFUDataSectionReader::TPEFUDataSectionReader ( )
protected

Constructor.

Registers itself to SectionReader.

Definition at line 54 of file TPEFUDataSectionReader.cc.

References TPEF::SectionReader::registerSectionReader().

Here is the call graph for this function:

◆ ~TPEFUDataSectionReader()

TPEF::TPEFUDataSectionReader::~TPEFUDataSectionReader ( )
protectedvirtual

Destructor.

Definition at line 61 of file TPEFUDataSectionReader.cc.

61  {
62 }

◆ TPEFUDataSectionReader() [2/2]

TPEF::TPEFUDataSectionReader::TPEFUDataSectionReader ( const TPEFUDataSectionReader )
private

Copying not allowed.

Member Function Documentation

◆ operator=()

TPEFUDataSectionReader& TPEF::TPEFUDataSectionReader::operator= ( TPEFUDataSectionReader )
private

Assignment not allowed.

◆ readData()

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

Reads section data from TPEF 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.

Reimplemented from TPEF::TPEFSectionReader.

Definition at line 87 of file TPEFUDataSectionReader.cc.

87  {
88  // base classes implementation must be called with these TPEF readers
89  TPEFSectionReader::readData(stream, section);
90 
91  UDataSection* uDataSection = dynamic_cast<UDataSection*>(section);
92  assert(uDataSection != NULL);
93 
94  // check that link section is defined properly
95  assert(header().linkId == 0);
96 
97  dynamic_cast<TPEFReader*>(
98  parent())->addSectionSize(section, header().bodyLength);
99 
100  uDataSection->setDataLength(header().bodyLength);
101 }

References assert, TPEF::TPEFSectionReader::Header::bodyLength, TPEF::TPEFSectionReader::header(), TPEF::TPEFSectionReader::parent(), TPEF::TPEFSectionReader::readData(), and TPEF::RawSection::setDataLength().

Here is the call graph for this function:

◆ type()

Section::SectionType TPEF::TPEFUDataSectionReader::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 70 of file TPEFUDataSectionReader.cc.

70  {
71  return Section::ST_UDATA;
72 }

References TPEF::Section::ST_UDATA.

Member Data Documentation

◆ proto_

TPEFUDataSectionReader TPEF::TPEFUDataSectionReader::proto_
staticprivate

Prototype instance of TPEFUDataSectionReader to be registered to SectionReader.

Definition at line 58 of file TPEFUDataSectionReader.hh.


The documentation for this class was generated from the following files:
TPEF::TPEFSectionReader::TPEFSectionReader
TPEFSectionReader()
Definition: TPEFSectionReader.cc:50
assert
#define assert(condition)
Definition: Application.hh:86
TPEF::SectionReader::registerSectionReader
static void registerSectionReader(const SectionReader *sReader)
Definition: SectionReader.cc:145
TPEF::Section::ST_UDATA
@ ST_UDATA
Uninitialized data section.
Definition: Section.hh:81
TPEF::TPEFSectionReader::parent
virtual BinaryReader * parent() const
Definition: TPEFSectionReader.cc:65
TPEF::TPEFSectionReader::readData
virtual void readData(BinaryStream &stream, Section *section) const
Definition: TPEFSectionReader.cc:86
TPEF::TPEFSectionReader::header
static const Header & header()
Definition: TPEFSectionReader.cc:174
TPEF::TPEFSectionReader::Header::bodyLength
Word bodyLength
Definition: TPEFSectionReader.hh:70