top | up | prev | next

ModuleCache Class

Definition at line 14 of ModuleCache.hpp

Constructors

ModuleCache()
ModuleCache(ModuleCache&&) delete
ModuleCache(const ModuleCache&) delete

Member Functions

void CollectModuleIndices(Module* module, std::unordered_set<int>& moduleIndices)
void Done() static
Module* GetCachedModule(const std::string& moduleFilePath) const
Module* GetModule(const boost::uuids::uuid& moduleId) const
Module* GetModule(const std::string& moduleFilePath)
bool HasModule(const std::string& moduleFilePath) const
void Init() static
ModuleCache& Instance() static
void MapModule(Module* module)
void MoveNonSystemModulesTo(ModuleCache* cache)
void PutModule(std::unique_ptr<Module>&& module)
std::unique_ptr<ModuleCache> Release() static
void RemoveModule(const std::string& moduleFilePath)
void ResetCacheEntries(Module* module)
Module* ResetModule(const std::string& moduleFilePath)
void Restore(ModuleCache* prevCache)
void SetModule(const std::string& moduleFilePath, std::unique_ptr<Module>&& module)
void Update()
ModuleCache& operator=(ModuleCache&&) delete
ModuleCache& operator=(const ModuleCache&) delete

Member Variables

std::unique_ptr<ModuleCache> instance static
std::unordered_map<boost::uuids::uuid, Module*, boost::hash<boost::uuids::uuid>> moduleIdMap
std::unordered_map<std::string, int> moduleMap
std::vector<std::unique_ptr<Module>> modules

Constructor Details

ModuleCache Constructor

cmajor::symbols::ModuleCache::ModuleCache()

Definition at line 49 of ModuleCache.cpp :
 49 : moduleMap()modules()
 50 {
 51 }


Declaration at line 17 of ModuleCache.hpp


ModuleCache Constructor

cmajor::symbols::ModuleCache::ModuleCache(ModuleCache &&) delete

Definition at line 19 of ModuleCache.hpp


ModuleCache Constructor

cmajor::symbols::ModuleCache::ModuleCache(const ModuleCache &) delete

Definition at line 18 of ModuleCache.hpp


Member Function Details

CollectModuleIndices Member Function

void cmajor::symbols::ModuleCache::CollectModuleIndices(Module * module, std::unordered_set<int >& moduleIndices)

Definition at line 53 of ModuleCache.cpp
Declaration at line 44 of ModuleCache.hpp

Calls: cmajor::symbols::Module::Index , cmajor::symbols::Module::IsRootModule , cmajor::symbols::Module::ReferencedModules , cmajor::symbols::ModuleCache::CollectModuleIndices

Called by: cmajor::symbols::ModuleCache::CollectModuleIndices , cmajor::symbols::ModuleCache::ResetCacheEntries


Done Member Function

void cmajor::symbols::ModuleCache::Done() static

Definition at line 39 of ModuleCache.cpp :
 40 {
 41     instance.reset();
 42 }


Declaration at line 23 of ModuleCache.hpp


GetCachedModule Member Function

Module * cmajor::symbols::ModuleCache::GetCachedModule(const std::string& moduleFilePath) const

Definition at line 142 of ModuleCache.cpp
Declaration at line 29 of ModuleCache.hpp


GetModule Member Function

Module * cmajor::symbols::ModuleCache::GetModule(const boost::uuids::uuid& moduleId) const

Definition at line 124 of ModuleCache.cpp
Declaration at line 27 of ModuleCache.hpp


GetModule Member Function

Module * cmajor::symbols::ModuleCache::GetModule(const std::string& moduleFilePath)

Definition at line 100 of ModuleCache.cpp
Declaration at line 26 of ModuleCache.hpp

Called by: cmajor::symbols::ModuleCache::ResetModule


HasModule Member Function

bool cmajor::symbols::ModuleCache::HasModule(const std::string& moduleFilePath) const

Definition at line 262 of ModuleCache.cpp
Declaration at line 35 of ModuleCache.hpp

Calls: cmajor::symbols::Module::HasSymbolTable


Init Member Function

void cmajor::symbols::ModuleCache::Init() static

Definition at line 34 of ModuleCache.cpp :
 35 {
 36     instance.reset(new ModuleCache());
 37 }


Declaration at line 22 of ModuleCache.hpp


Instance Member Function

ModuleCache & cmajor::symbols::ModuleCache::Instance() static

Definition at line 25 of ModuleCache.hpp :
25 { return *instance; }


MapModule Member Function

void cmajor::symbols::ModuleCache::MapModule(Module * module)

Definition at line 137 of ModuleCache.cpp :
138 {
139     moduleIdMap[module->Id()] = module;
140 }


Declaration at line 28 of ModuleCache.hpp

Calls: cmajor::symbols::Module::Id


MoveNonSystemModulesTo Member Function

void cmajor::symbols::ModuleCache::MoveNonSystemModulesTo(ModuleCache * cache)

Definition at line 322 of ModuleCache.cpp
Declaration at line 37 of ModuleCache.hpp

Calls: cmajor::symbols::ModuleCache::SetModule


PutModule Member Function

void cmajor::symbols::ModuleCache::PutModule(std::unique_ptr<Module >&& module)

Definition at line 160 of ModuleCache.cpp
Declaration at line 30 of ModuleCache.hpp

Calls: cmajor::symbols::ModuleCache::ResetCacheEntries


Release Member Function

std::unique_ptr<ModuleCache > cmajor::symbols::ModuleCache::Release() static

Definition at line 44 of ModuleCache.cpp :
 45 {
 46     return std::move(instance);
 47 }


Declaration at line 24 of ModuleCache.hpp


RemoveModule Member Function

void cmajor::symbols::ModuleCache::RemoveModule(const std::string& moduleFilePath)

Definition at line 80 of ModuleCache.cpp
Declaration at line 33 of ModuleCache.hpp

Calls: cmajor::symbols::Module::FilePathReadFrom , cmajor::symbols::Module::OriginalFilePath


ResetCacheEntries Member Function

void cmajor::symbols::ModuleCache::ResetCacheEntries(Module * module)

Definition at line 70 of ModuleCache.cpp :
 71 {
 72     std::unordered_set<int> moduleIndices;
 73     CollectModuleIndices(modulemoduleIndices);
 74     for (int moduleIndex : moduleIndices)
 75     {
 76         modules[moduleIndex].reset();
 77     }
 78 }


Declaration at line 32 of ModuleCache.hpp

Calls: cmajor::symbols::ModuleCache::CollectModuleIndices

Called by: cmajor::symbols::ModuleCache::PutModule


ResetModule Member Function

Module * cmajor::symbols::ModuleCache::ResetModule(const std::string& moduleFilePath)

Definition at line 195 of ModuleCache.cpp
Declaration at line 31 of ModuleCache.hpp

Calls: cmajor::symbols::ModuleCache::GetModule


Restore Member Function

void cmajor::symbols::ModuleCache::Restore(ModuleCache * prevCache)

Definition at line 222 of ModuleCache.cpp
Declaration at line 34 of ModuleCache.hpp

Calls: cmajor::symbols::Module::HasSymbolTable


SetModule Member Function

void cmajor::symbols::ModuleCache::SetModule(const std::string& moduleFilePath, std::unique_ptr<Module >&& module)

Definition at line 277 of ModuleCache.cpp :
278 {
279     int moduleIndex = modules.size();
280     moduleMap[moduleFilePath] = moduleIndex;
281     module->SetIndex(moduleIndex);
282     moduleIdMap[module->Id()] = module.get();
283     modules.push_back(std::move(module));
284 }


Declaration at line 36 of ModuleCache.hpp

Called by: cmajor::symbols::ModuleCache::MoveNonSystemModulesTo


Update Member Function

void cmajor::symbols::ModuleCache::Update()

Definition at line 286 of ModuleCache.cpp
Declaration at line 38 of ModuleCache.hpp

Calls: cmajor::symbols::Module::FilePathReadFrom , cmajor::symbols::Module::Id , cmajor::symbols::Module::OriginalFilePath , cmajor::symbols::Module::SetIndex


operator= Member Function

ModuleCache & cmajor::symbols::ModuleCache::operator=(ModuleCache &&) delete

Definition at line 21 of ModuleCache.hpp


operator= Member Function

ModuleCache & cmajor::symbols::ModuleCache::operator=(const ModuleCache &) delete

Definition at line 20 of ModuleCache.hpp


top | up | prev | next