ICG 2
Electric Boogaloo
Public Member Functions | List of all members
AllocInfo Class Reference

#include <AllocInfo.hpp>

Public Member Functions

 AllocInfo (const std::string &varName, std::shared_ptr< const DataType > type, void *suppliedAllocation=0)
 
 AllocInfo (const AllocInfo &other)=delete
 
 ~AllocInfo ()
 
std::string getName () const
 
std::string getSerialName () const
 
unsigned int getSerialNumber () const
 
void * getStart () const
 
int getSize () const
 
std::string getTypeSpecifierName () const
 
unsigned int getDimensionsCount () const
 
int getDimensionSize (unsigned int n) const
 
std::shared_ptr< const DataTypegetDataType () const
 
StorageClass::e getStorageClass () const
 
void clear () const
 Clear the every element of the allocation to 0. Tested in: AllocInfoTest::clear. More...
 
bool contains (void *address) const
 
bool getVarAccessInfo (LexicalAnalyzer *lexer, VarAccessInfo &varAccessInfo)
 
std::string toString () const
 

Detailed Description

The AllocInfo class describes a chunk of memory that the MemoryManager knows about.

Constructor & Destructor Documentation

◆ AllocInfo() [1/2]

AllocInfo::AllocInfo ( const std::string &  varName,
std::shared_ptr< const DataType type,
void *  suppliedAllocation = 0 
)

◆ AllocInfo() [2/2]

AllocInfo::AllocInfo ( const AllocInfo other)
delete

◆ ~AllocInfo()

AllocInfo::~AllocInfo ( )

AllocInfo destructor.

Note
This also deletes the underlying allocation if it was allocated locally.

Member Function Documentation

◆ clear()

void AllocInfo::clear ( ) const

Clear the every element of the allocation to 0. Tested in: AllocInfoTest::clear.

◆ contains()

bool AllocInfo::contains ( void *  address) const
Returns
true, if the allocation contains the given address. Otherwise return false.

◆ getDataType()

std::shared_ptr< const DataType > AllocInfo::getDataType ( ) const
Returns
the DataType for the allocation.

◆ getDimensionsCount()

unsigned int AllocInfo::getDimensionsCount ( ) const
Returns
the number of dimensions. Tested in: AllocInfoTest::getters1, AllocInfoTest::getters2.

◆ getDimensionSize()

int AllocInfo::getDimensionSize ( unsigned int  n) const
Parameters
nindex of the dimension.
Returns
the size of the nth dimension. Tested in: AllocInfoTest::getters1, AllocInfoTest::getters2.

◆ getName()

std::string AllocInfo::getName ( ) const
Returns
the name given to the allocation. Tested in: AllocInfoTest::getters1 AllocInfoTest::getters2.

◆ getSerialName()

std::string AllocInfo::getSerialName ( ) const

◆ getSerialNumber()

unsigned int AllocInfo::getSerialNumber ( ) const

◆ getSize()

int AllocInfo::getSize ( ) const
Returns
the size of the allocation in bytes. Tested in: AllocInfoTest::getters1, AllocInfoTest::getters2.

◆ getStart()

void * AllocInfo::getStart ( ) const
Returns
the starting address of the allocation. Tested in: AllocInfoTest::getters1, AllocInfoTest::getters2.

◆ getStorageClass()

StorageClass::e AllocInfo::getStorageClass ( ) const
Returns
Get

◆ getTypeSpecifierName()

std::string AllocInfo::getTypeSpecifierName ( ) const
Returns
the type specifier. Tested in: AllocInfoTest::getters1, AllocInfoTest::getters2.

◆ getVarAccessInfo()

bool AllocInfo::getVarAccessInfo ( LexicalAnalyzer lexer,
VarAccessInfo &  varAccessInfo 
)

◆ toString()

std::string AllocInfo::toString ( ) const

The documentation for this class was generated from the following files: