Go to the documentation of this file.
49 using ReferenceManager::SafePointer;
50 using ReferenceManager::SectionOffsetKey;
97 TCEString(
"No prototype for section type: ") +
124 (*prototypes_)[section->
type()] = section;
170 throw NotChunkable(__FILE__, __LINE__,
"Section::chunk");
213 Chunk* newChunk = NULL;
221 newChunk =
new Chunk(offset);
303 Word mauSize =
static_cast<Word
>(
304 ceil(
static_cast<double>(
aSpace()->
MAU()) /
308 assert ((bytes % mauSize) == 0);
310 return bytes / mauSize;
324 abortWithError(
"MAU of address space can't be zero for this method.");
327 Word mauSize =
static_cast<Word
>(
328 ceil(
static_cast<double>(
aSpace()->
MAU()) /
331 return maus * mauSize;
virtual bool isChunkable() const
static SectionPrototypeMap * prototypes_
Container for registere section prototypes.
virtual Chunk * chunk(SectionOffset offset) const
virtual Word lengthInMAUs() const
ASpaceElement * aSpace() const
Word referredChunkCount() const
virtual void setDataLength(Word length)
std::map< SectionType, const Section * > SectionPrototypeMap
Type of map that contains section prototypes.
virtual void setElement(Word index, SectionElement *element)
virtual SectionType type() const =0
Returns SectioType of actual section instance.
virtual bool isChunkable() const
virtual Word MAUsToBytes(Word mauCount) const
static std::string toString(const T &source)
std::vector< Chunk * > referredChunksCache_
Table containing all the chunks that are requested from section.
bool belongsToSection(const Chunk *chunk) const
ChunkMap dataChunks_
Container for already created chunks.
SectionElement * element(Word index) const
#define assert(condition)
virtual void addElement(SectionElement *element)
virtual void assureInSection(SectionOffset offset) const
#define abortWithError(message)
Word length_
The length of raw data section.
static Section * createSection(SectionType type)
Chunk * referredChunk(Word index) const
virtual Word bytesToMAUs(Word byteCount) const
MinimumAddressableUnit MAU
std::vector< SectionElement * > elements_
Contain elements.
std::string errorMessage() const
static const Byte PROGRAM_SECTION_MASK
Mask for checking if section is auxiliary or program section.
static void registerSection(const Section *section)
Word SectionOffset
Type for storing offsets relative to a given base offset value.
SectionOffset offset() const
virtual void setLengthInMAUs(Word length)
virtual Word length() const
virtual Chunk * chunk(SectionOffset offset) const
virtual Word chunkToMAUIndex(const Chunk *chunk) const
virtual Section * clone() const =0
Creates clone of instance.
Word elementCount() const