Class sh::tools::OperationsCache

class sh::tools::OperationsCache : public QObject, public sh::base::Singleton

A cached factory for readonly sh::filesystem::Operation instances.

You can use it for fetching an sh::filesystem::Operation for a certain sh::filesystem::Eurl. Two restrictions apply:

  • Data might be slightly outdated.

  • Just for read-only access.

Public Functions

std::shared_ptr<sh::filesystem::Operation> getOperationForContainer(std::shared_ptr<const sh::filesystem::Eurl> container)

Returns a cached sh::filesystem::Operation for a container (by eurl).

void doInitialize()

Executes singleton initialization.

void doShutdown()

Executes singleton shutdown.

void shutdown()

Shutdown down this singleton.

bool isAlive()

Returns if this singleton is alive (true until its shutdown begins).

Private Functions

OperationsCache()

Private Members

QHash<std::shared_ptr<const sh::filesystem::Eurl>, std::shared_ptr<sh::filesystem::Operation>> cache
QMutex cachemutex