top | up | prev | next

CompileData Class

Definition at line 36 of Compiler.cpp

Member Functions

void Done() static
int GetCompileResult(int compileResultHandle, char16_t* buf, int size)
int GetCompileResultLength(int compileResultHandle)
void Init() static
CompileData& Instance() static
int SetCompileResult(const std::u16string& compileResult)

Member Variables

std::vector<std::unique_ptr<std::u16string>> compileResults
std::unique_ptr<CompileData> instance static
std::mutex mtx

Member Function Details

Done Member Function

void CompileData::Done() static

Definition at line 58 of Compiler.cpp :
 59 {
 60     instance.reset();
 61 }


Declaration at line 40 of Compiler.cpp


GetCompileResult Member Function

int CompileData::GetCompileResult(int compileResultHandle, char16_t * buf, int size)

Definition at line 80 of Compiler.cpp
Declaration at line 44 of Compiler.cpp


GetCompileResultLength Member Function

int CompileData::GetCompileResultLength(int compileResultHandle)

Definition at line 71 of Compiler.cpp :
 72 {
 73     std::lock_guard<std::mutex> lock(mtx);
 74     if (compileResultHandle < 0 || compileResultHandle >= compileResults.size()) return -1;
 75     if (!compileResults[compileResultHandle]) return -1;
 76     const std::u16string& compileResult = *compileResults[compileResultHandle];
 77     return compileResult.length();
 78 }


Declaration at line 43 of Compiler.cpp


Init Member Function

void CompileData::Init() static

Definition at line 53 of Compiler.cpp :
 54 {
 55     instance.reset(new CompileData());
 56 }


Declaration at line 39 of Compiler.cpp


Instance Member Function

CompileData & CompileData::Instance() static

Definition at line 41 of Compiler.cpp :
 41 { return *instance; }


SetCompileResult Member Function

int CompileData::SetCompileResult(const std::u16string& compileResult)

Definition at line 63 of Compiler.cpp :
 64 {
 65     std::lock_guard<std::mutex> lock(mtx);
 66     int compileResultHandle = compileResults.size();
 67     compileResults.push_back(std::unique_ptr<std::u16string>(new std::u16string(compileResult)));
 68     return compileResultHandle;
 69 }


Declaration at line 42 of Compiler.cpp


top | up | prev | next