49using ReferenceManager::SafePointer;
50using 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;
#define abortWithError(message)
#define assert(condition)
MinimumAddressableUnit MAU
static std::string toString(const T &source)
std::string errorMessage() const
SectionOffset offset() const
virtual Word bytesToMAUs(Word byteCount) const
virtual bool isChunkable() const
ChunkMap dataChunks_
Container for already created chunks.
virtual void assureInSection(SectionOffset offset) const
virtual void setLengthInMAUs(Word length)
Chunk * referredChunk(Word index) const
virtual Chunk * chunk(SectionOffset offset) const
virtual Word chunkToMAUIndex(const Chunk *chunk) const
virtual Word length() const
std::vector< Chunk * > referredChunksCache_
Table containing all the chunks that are requested from section.
Word length_
The length of raw data section.
virtual void setDataLength(Word length)
Word referredChunkCount() const
virtual Word MAUsToBytes(Word mauCount) const
virtual Word lengthInMAUs() const
bool belongsToSection(const Chunk *chunk) const
static Section * createSection(SectionType type)
virtual void setElement(Word index, SectionElement *element)
static void registerSection(const Section *section)
virtual void addElement(SectionElement *element)
virtual Chunk * chunk(SectionOffset offset) const
std::map< SectionType, const Section * > SectionPrototypeMap
Type of map that contains section prototypes.
static SectionPrototypeMap * prototypes_
Container for registere section prototypes.
SectionElement * element(Word index) const
virtual Section * clone() const =0
Creates clone of instance.
Word elementCount() const
static const Byte PROGRAM_SECTION_MASK
Mask for checking if section is auxiliary or program section.
virtual bool isChunkable() const
virtual SectionType type() const =0
Returns SectioType of actual section instance.
std::vector< SectionElement * > elements_
Contain elements.
ASpaceElement * aSpace() const
Word SectionOffset
Type for storing offsets relative to a given base offset value.