top | up | prev | next

DataRepository Class

Definition at line 29 of Data.hpp

Constructors

DataRepository()
DataRepository(const DataRepository&) delete

Member Functions

GlobalVariable* CreateGlobalStringPtr(Context& context, const std::string& stringValue)
GlobalVariable* GetOrInsertGlobal(const std::string& name, Type* type)
void SetCompileUnitId(const std::string& compileUnitId_)
void Write(Context& context, CodeFormatter& formatter)
DataRepository& operator=(const DataRepository&) delete

Member Variables

std::string compileUnitId
std::vector<std::unique_ptr<GlobalVariable>> globalVariableDefinitions
std::unordered_map<std::string, GlobalVariable*> globalVariableMap
int nextStringId

Constructor Details

DataRepository Constructor

cmsxi::DataRepository::DataRepository()

Definition at line 56 of Data.cpp :
 56 : globalVariableDefinitions()globalVariableMap()nextStringId(0)
 57 {
 58 }


Declaration at line 32 of Data.hpp


DataRepository Constructor

cmsxi::DataRepository::DataRepository(const DataRepository &) delete

Definition at line 33 of Data.hpp


Member Function Details

CreateGlobalStringPtr Member Function

GlobalVariable * cmsxi::DataRepository::CreateGlobalStringPtr(Context & context, const std::string& stringValue)

Definition at line 73 of Data.cpp :
 74 {
 75     GlobalVariable* globalVariable = new GlobalVariable(context.GetByteType()"string" + std::to_string(nextStringId++) + "_" + compileUnitId);
 76     globalVariable->SetInitializer(context.GetStringValue(globalVariable->GetType(context)stringValue));
 77     globalVariableDefinitions.push_back(std::unique_ptr<GlobalVariable>(globalVariable));
 78     return globalVariable;
 79 }


Declaration at line 36 of Data.hpp

Calls: cmsxi::Context::GetByteType , cmsxi::Context::GetStringValue , cmsxi::GlobalVariable::GetType , cmsxi::GlobalVariable::SetInitializer

Called by: cmsxi::Context::CreateGlobalStringPtr


GetOrInsertGlobal Member Function

GlobalVariable * cmsxi::DataRepository::GetOrInsertGlobal(const std::string& name, Type * type)

Definition at line 60 of Data.cpp
Declaration at line 35 of Data.hpp

Called by: cmsxi::Context::GetOrInsertGlobal


SetCompileUnitId Member Function

void cmsxi::DataRepository::SetCompileUnitId(const std::string& compileUnitId_)

Definition at line 161 of Data.cpp :
162 {
163     compileUnitId = compileUnitId_;
164 }


Declaration at line 38 of Data.hpp

Called by: cmsxi::Context::SetCompileUnitId


Write Member Function

void cmsxi::DataRepository::Write(Context & context, CodeFormatter& formatter)

Definition at line 144 of Data.cpp
Declaration at line 37 of Data.hpp

Calls: cmsxi::DataRepository::Write

Called by: cmsxi::CompileUnit::Write , cmsxi::DataRepository::Write


operator= Member Function

DataRepository & cmsxi::DataRepository::operator=(const DataRepository &) delete

Definition at line 34 of Data.hpp


top | up | prev | next