top | up | prev | next

ErrorTable Class

Definition at line 19 of Error.cpp

Constructors

ErrorTable()

Member Functions

void DisposeError(int32_t errorId)
void Done() static
const char* GetError(int32_t errorId)
void Init() static
int32_t InstallError(const std::string& errorMessage)
ErrorTable& Instance() static

Member Variables

std::unordered_map<int32_t, std::string> errorMap
std::unique_ptr<ErrorTable> instance static
std::mutex mtx
int32_t nextErrorId

Constructor Details

ErrorTable Constructor

cmajor::rt::ErrorTable::ErrorTable()

Definition at line 48 of Error.cpp :
 48 : nextErrorId(1)
 49 {
 50 }


Declaration at line 33 of Error.cpp


Member Function Details

DisposeError Member Function

void cmajor::rt::ErrorTable::DisposeError(int32_t errorId)

Definition at line 74 of Error.cpp :
 75 {
 76     std::lock_guard<std::mutex> lock(mtx);
 77     errorMap.erase(errorId);
 78 }


Declaration at line 27 of Error.cpp


Done Member Function

void cmajor::rt::ErrorTable::Done() static

Definition at line 43 of Error.cpp :
 44 {
 45     instance.reset();
 46 }


Declaration at line 23 of Error.cpp


GetError Member Function

const char * cmajor::rt::ErrorTable::GetError(int32_t errorId)

Definition at line 60 of Error.cpp
Declaration at line 26 of Error.cpp


Init Member Function

void cmajor::rt::ErrorTable::Init() static

Definition at line 38 of Error.cpp :
 39 {
 40     instance.reset(new ErrorTable());
 41 }


Declaration at line 22 of Error.cpp


InstallError Member Function

int32_t cmajor::rt::ErrorTable::InstallError(const std::string& errorMessage)

Definition at line 52 of Error.cpp :
 53 {
 54     std::lock_guard<std::mutex> lock(mtx);
 55     int32_t errorId = nextErrorId++;
 56     errorMap[errorId] = errorMessage;
 57     return errorId;
 58 }


Declaration at line 25 of Error.cpp


Instance Member Function

ErrorTable & cmajor::rt::ErrorTable::Instance() static

Definition at line 24 of Error.cpp :
 24 { Assert(instance"error table not initialized"); return *instance; }


top | up | prev | next