top | up | prev | next

StaticInitTable Class

Definition at line 19 of Statics.cpp

Member Functions

void AllocateMutexes(const std::vector<boost::uuids::uuid>& staticClassIds)
void BeginCriticalSection(const boost::uuids::uuid& classId)
void Done() static
void EndCriticalSection(const boost::uuids::uuid& classId)
void Init() static
StaticInitTable& Instance() static

Member Variables

std::unique_ptr<StaticInitTable> instance static
std::unordered_map<boost::uuids::uuid, int, boost::hash<boost::uuids::uuid>> mutexMap
std::vector<std::unique_ptr<std::recursive_mutex>> mutexes

Member Function Details

AllocateMutexes Member Function

void cmajor::rt::StaticInitTable::AllocateMutexes(const std::vector<boost::uuids::uuid>& staticClassIds)

Definition at line 46 of Statics.cpp :
 47 {
 48     int n = staticClassIds.size();
 49     for (int i = 0; i < n; ++i)
 50     {
 51         const boost::uuids::uuid& classId = staticClassIds[i];
 52         mutexMap[classId] = mutexes.size();
 53         mutexes.push_back(std::unique_ptr<std::recursive_mutex>(new std::recursive_mutex()));
 54     }
 55 }


Declaration at line 25 of Statics.cpp


BeginCriticalSection Member Function

void cmajor::rt::StaticInitTable::BeginCriticalSection(const boost::uuids::uuid& classId)

Definition at line 57 of Statics.cpp
Declaration at line 26 of Statics.cpp


Done Member Function

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

Definition at line 41 of Statics.cpp :
 42 {
 43     instance.reset();
 44 }


Declaration at line 23 of Statics.cpp


EndCriticalSection Member Function

void cmajor::rt::StaticInitTable::EndCriticalSection(const boost::uuids::uuid& classId)

Definition at line 73 of Statics.cpp
Declaration at line 27 of Statics.cpp


Init Member Function

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

Definition at line 36 of Statics.cpp :
 37 {
 38     instance.reset(new StaticInitTable());
 39 }


Declaration at line 22 of Statics.cpp


Instance Member Function

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

Definition at line 24 of Statics.cpp :
 24 { return *instance; }


top | up | prev | next