#include <DesignCache.h>
Public Types | |
| enum class | LoadState { Unloaded , Loading , Loaded , Failed } |
| enum class | JsonPayloadKind { Design , FileModel } |
| using | LoadEventCallback = std::function< void(const std::string &designName, LoadState from, LoadState to)> |
Public Member Functions | |
| DesignCache (std::string directory) | |
| ~DesignCache () | |
| std::shared_ptr< ProductModel::Design > | GetDesign (const std::string &designName) |
| std::shared_ptr< FileModel::Design::FileArchive > | GetFileArchive (const std::string &designName) |
| void | AddFileArchive (const std::string &designName, std::shared_ptr< FileModel::Design::FileArchive > fileArchive, bool save, std::uint64_t injectedBytes=0) |
| void | InvalidateDesign (const std::string &designName) |
| bool | SaveFileArchive (const std::string &designName) |
| std::vector< std::string > | getLoadedDesignNames (const std::string &filter="") const |
| std::vector< std::string > | getLoadedFileArchiveNames (const std::string &filter="") const |
| std::vector< std::string > | getUnloadedDesignNames (const std::string &filter="") const |
| int | loadAllFileArchives (bool stopOnError) |
| int | loadAllDesigns (bool stopOnError) |
| int | loadFileArchives (const Utils::StringVector &names) |
| int | loadDesigns (const Utils::StringVector &names) |
| void | setDirectory (const std::string &directory) |
| std::string | getDirectory () const |
| void | Clear () |
| void | ensureDirectoryExists () const |
| LoadState | GetLoadState (const std::string &designName) const |
| void | AddLoadObserver (LoadEventCallback callback) |
| bool | LoadDesignAsync (const std::string &designName) |
| bool | ContainsDesign (const std::string &designName) const |
| void | setCacheMaxBytes (std::uint64_t maxBytes) |
| std::uint64_t | getCacheMaxBytes () const |
| void | setMaxBackgroundLoads (std::size_t maxLoads) |
| std::size_t | getMaxBackgroundLoads () const |
| bool | TryGetDesignBytes (const std::string &designName, std::string &outBytes) const |
| bool | TryGetJsonPayload (const std::string &designName, JsonPayloadKind kind, std::string &outJson) const |
| bool | HasCachedResponse (const std::string &designName) const |
| void | SerializeResponsePayloads (const std::string &designName) |
| std::uint64_t | designSerializationCount () const |
| std::uint64_t | GetResponseGeneration (const std::string &designName) const |
| std::uint64_t | cachedBytes () const |
| std::uint64_t | cachedResponseBytes () const |
| void | setMonolithicWireBudget (std::uint64_t maxBytes) |
| std::uint64_t | getMonolithicWireBudget () const |
Definition at line 27 of file DesignCache.h.
| using Odb::Lib::App::DesignCache::LoadEventCallback = std::function<void(const std::string& designName, LoadState from, LoadState to)> |
Definition at line 47 of file DesignCache.h.
|
strong |
| Enumerator | |
|---|---|
| Design | |
| FileModel | |
Definition at line 154 of file DesignCache.h.
|
strong |
| Enumerator | |
|---|---|
| Unloaded | |
| Loading | |
| Loaded | |
| Failed | |
Definition at line 36 of file DesignCache.h.
| Odb::Lib::App::DesignCache::DesignCache | ( | std::string | directory | ) |
| Odb::Lib::App::DesignCache::~DesignCache | ( | ) |
| void Odb::Lib::App::DesignCache::AddFileArchive | ( | const std::string & | designName, |
| std::shared_ptr< FileModel::Design::FileArchive > | fileArchive, | ||
| bool | save, | ||
| std::uint64_t | injectedBytes = 0 |
||
| ) |
| void Odb::Lib::App::DesignCache::AddLoadObserver | ( | LoadEventCallback | callback | ) |
Definition at line 397 of file DesignCache.cpp.
| std::uint64_t Odb::Lib::App::DesignCache::cachedBytes | ( | ) | const |
Definition at line 850 of file DesignCache.cpp.
| std::uint64_t Odb::Lib::App::DesignCache::cachedResponseBytes | ( | ) | const |
Definition at line 1094 of file DesignCache.cpp.
| void Odb::Lib::App::DesignCache::Clear | ( | ) |
| bool Odb::Lib::App::DesignCache::ContainsDesign | ( | const std::string & | designName | ) | const |
| std::uint64_t Odb::Lib::App::DesignCache::designSerializationCount | ( | ) | const |
Definition at line 1089 of file DesignCache.cpp.
| void Odb::Lib::App::DesignCache::ensureDirectoryExists | ( | ) | const |
| std::uint64_t Odb::Lib::App::DesignCache::getCacheMaxBytes | ( | ) | const |
Definition at line 422 of file DesignCache.cpp.
| std::shared_ptr< ProductModel::Design > Odb::Lib::App::DesignCache::GetDesign | ( | const std::string & | designName | ) |
| std::string Odb::Lib::App::DesignCache::getDirectory | ( | ) | const |
Definition at line 331 of file DesignCache.cpp.
| std::shared_ptr< FileModel::Design::FileArchive > Odb::Lib::App::DesignCache::GetFileArchive | ( | const std::string & | designName | ) |
| std::vector< std::string > Odb::Lib::App::DesignCache::getLoadedDesignNames | ( | const std::string & | filter = "" | ) | const |
Definition at line 148 of file DesignCache.cpp.
| std::vector< std::string > Odb::Lib::App::DesignCache::getLoadedFileArchiveNames | ( | const std::string & | filter = "" | ) | const |
Definition at line 159 of file DesignCache.cpp.
| DesignCache::LoadState Odb::Lib::App::DesignCache::GetLoadState | ( | const std::string & | designName | ) | const |
| std::size_t Odb::Lib::App::DesignCache::getMaxBackgroundLoads | ( | ) | const |
Definition at line 438 of file DesignCache.cpp.
| std::uint64_t Odb::Lib::App::DesignCache::getMonolithicWireBudget | ( | ) | const |
Definition at line 1105 of file DesignCache.cpp.
| std::uint64_t Odb::Lib::App::DesignCache::GetResponseGeneration | ( | const std::string & | designName | ) | const |
| std::vector< std::string > Odb::Lib::App::DesignCache::getUnloadedDesignNames | ( | const std::string & | filter = "" | ) | const |
Definition at line 170 of file DesignCache.cpp.
| bool Odb::Lib::App::DesignCache::HasCachedResponse | ( | const std::string & | designName | ) | const |
Definition at line 1084 of file DesignCache.cpp.
| void Odb::Lib::App::DesignCache::InvalidateDesign | ( | const std::string & | designName | ) |
Definition at line 111 of file DesignCache.cpp.
| int Odb::Lib::App::DesignCache::loadAllDesigns | ( | bool | stopOnError | ) |
Definition at line 238 of file DesignCache.cpp.
| int Odb::Lib::App::DesignCache::loadAllFileArchives | ( | bool | stopOnError | ) |
| bool Odb::Lib::App::DesignCache::LoadDesignAsync | ( | const std::string & | designName | ) |
| int Odb::Lib::App::DesignCache::loadDesigns | ( | const Utils::StringVector & | names | ) |
| int Odb::Lib::App::DesignCache::loadFileArchives | ( | const Utils::StringVector & | names | ) |
| bool Odb::Lib::App::DesignCache::SaveFileArchive | ( | const std::string & | designName | ) |
Definition at line 133 of file DesignCache.cpp.
| void Odb::Lib::App::DesignCache::SerializeResponsePayloads | ( | const std::string & | designName | ) |
Definition at line 1329 of file DesignCache.cpp.
| void Odb::Lib::App::DesignCache::setCacheMaxBytes | ( | std::uint64_t | maxBytes | ) |
| void Odb::Lib::App::DesignCache::setDirectory | ( | const std::string & | directory | ) |
| void Odb::Lib::App::DesignCache::setMaxBackgroundLoads | ( | std::size_t | maxLoads | ) |
| void Odb::Lib::App::DesignCache::setMonolithicWireBudget | ( | std::uint64_t | maxBytes | ) |
Definition at line 1099 of file DesignCache.cpp.
| bool Odb::Lib::App::DesignCache::TryGetDesignBytes | ( | const std::string & | designName, |
| std::string & | outBytes | ||
| ) | const |
Definition at line 1074 of file DesignCache.cpp.
| bool Odb::Lib::App::DesignCache::TryGetJsonPayload | ( | const std::string & | designName, |
| JsonPayloadKind | kind, | ||
| std::string & | outJson | ||
| ) | const |
Definition at line 1079 of file DesignCache.cpp.