Mercurial > hg > orthanc-stone
view Deprecated/Platforms/Wasm/WasmDelayedCallExecutor.h @ 1438:96044a18b98d
DicomStructureSetLoader instances are now indexed by their instanceid AND
a uniquekey that is passed (*not* depending on the initially visible structures anymore)
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Tue, 19 May 2020 15:29:47 +0200 |
parents | 419d0320c344 |
children | 828a9b4ee1b7 |
line wrap: on
line source
#pragma once #include "../../Framework/Deprecated/Toolbox/IDelayedCallExecutor.h" #include <Core/OrthancException.h> namespace Deprecated { class WasmDelayedCallExecutor : public IDelayedCallExecutor { private: static OrthancStone::MessageBroker* broker_; // Private constructor => Singleton design pattern WasmDelayedCallExecutor(OrthancStone::MessageBroker& broker) : IDelayedCallExecutor(broker) { } public: static WasmDelayedCallExecutor& GetInstance() { if (broker_ == NULL) { printf("WasmDelayedCallExecutor::GetInstance(): broker not initialized\n"); throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); } static WasmDelayedCallExecutor instance(*broker_); return instance; } static void SetBroker(OrthancStone::MessageBroker& broker) { broker_ = &broker; } virtual void Schedule(OrthancStone::MessageHandler<IDelayedCallExecutor::TimeoutMessage>* callback, unsigned int timeoutInMs = 1000); }; }