IAppJobListener;
125 static voidReleaseInstance();
140 boolRegisterEngine(
const string& name,
IAppJobEngine& engine);
145IEngineParams* params =
NULL);
151 boolauto_delete =
false,
152IEngineParams* params =
NULL);
158 boolauto_delete =
false,
159IEngineParams* params =
NULL);
166 voidMute(
boolbMute=
true);
168 voidCancelJob(
TJobIDjob_id);
169 voidSuspendJob(
TJobIDjob_id);
170 voidResumeJob(
TJobIDjob_id);
172 voidCancelAllJobs();
177 boolDeleteJob(
TJobIDjob_id);
195 voidUnlock()
const;
199 stringGetStatusString(
TJobStatejob_state);
224 intreport_period,
boolauto_delete);
237: m_JobId(job_id), m_Progress(progress) {}
247: m_Job(&job), m_NewState(new_state) {}
251 voidx_AddJobRecord(SJobRecord& rec);
252 voidx_RemoveJobRecord(SJobRecord& rec);
254TJobID x_StartJob(
IAppJob& job,
const string& engine_name,
256 boolauto_delete, IEngineParams* params);
261 IAppJobEngine* x_GetRegisteredEngine(
const string& engine_name);
262SJobRecord* x_GetJobRecord(TJobID job_id);
263SJobRecord* x_GetJobRecord(
IAppJob& job);
268 voidx_OnJobStateChanged(SJobRecord& rec, TJobState new_state);
270 voidx_OnJobStateChangedNotify(SJobRecord& rec);
271 voidx_OnJobProgressNotify(SJobRecord& rec);
273 boolx_PollEngines();
277 voidx_FlushStateEventQueue();
281 boolx_IsCanceled(
intjob_id)
const;
CAppJobEventTranslator Standard Listener that generates notification events.
IAppJobListener Interface for components that need to be notified about changes in Jobs.
CAppJobNotification Notification send by CAppJobEventTranslator.
CEvent - generic event implementation TODO TODO - Attachments.
IAppJobEngineListener - receives notifications about changes in job state.
#define EXCEPTION_VIRTUAL_BASE
Do not use virtual base classes in exception declaration at all, because in this case derived class s...
NCBI_EXCEPTION_DEFAULT(CAppJobException, CException)
CConstIRef< IAppJobError > GetError() const
returns non-null pointer only if job Failed
CConstIRef< IAppJobProgress > m_Progress
IAppJob::EJobState TJobState
TTimeToItem m_PollQueue
Job Index (by pointer)
SQueueItem(int job_id, bool progress)
multimap< time_t, SQueueItem > TTimeToItem
static CRef< CAppJobDispatcher > sm_Dispatcher
global dispatcher, this instance is used by default in most cases, however it is possible to create a...
CRef< CObject > GetResult() const
returns non-null pointer only if Completed or Running and has temporary results available
virtual ~IAppJobEngineListener()
IAppJob::EJobState TJobState
CGuard< CAppJobDispatcher > TDispatcherGuard
CEventHandler & m_TargetEventHandler
map< string, CIRef< IAppJobEngine > > TNameToEngine
map< IAppJob *, SJobRecord * > TPtrToRec
CConstIRef< IAppJobError > m_Error
TStateEventQueue m_StateEventQueue
priority queue for Dispatcher to poll on
SJobStateEvent(IAppJob &job, TJobState new_state)
bool m_AutoDelete
delete the record when job finishes
int m_ReportPeriod
if > 0, active progress reporting is required
DECLARE_CLASS_STATIC_MUTEX(sm_Mutex)
CWeakIRef< CEventHandler > m_TargetWeakPtr
CFastMutex m_EngineMutex
Engines registry mutex.
CIRef< CAppJobEventTranslator > m_Listener
if not null - "active" mode
EJobState
Job states (describe FSM)
bool m_ShutDownInProgress
Shutdown flag.
TPtrToRec m_PtrToRec
Job Registry (index by JobID)
IAppJob::EJobState TJobState
CConstIRef< IAppJobProgress > GetProgress() const
returns non-null pointer only if notification type is eProgress
CAppJobDispatcher::TJobID TJobID
bool ActiveProgress() const
IAppJob::EJobState TJobState
list< SJobStateEvent > TStateEventQueue
TJobState GetState() const
TNameToEngine m_NameToEngine
Engines Registry.
map< TJobID, SJobRecord * > TIDToRec
CConstIRef< IAppJobProgress > m_Progress
CAppJobDispatcher::TJobID TJobID
CMutex m_MainMutex
guards this instance of the Dispatcher
virtual void OnEngineJobStateChanged(IAppJob &job, TJobState new_state)=0
CAppJobDispatcher * m_Dispatcher
CFastMutex m_StateEventMutex
bm::bvector m_CancelVect
Canceled jobs vector.
@ eEngine_UnknownJob
the job is not registered in the Engine
@ eUnknownJob
Job record lost.
@ eEngine_InvalidParams
Invalid parameters provided to the Engine.
@ eEngineFailed
Engine failed to perforn an operation.
@ eEngine_IncompatibleJob
the Job is incompatible with the Engine
@ eEngineBusy
Engine is busy, caller needs to re-try the operation.
@ eInvalidOperation
Dispatcher - operation is invalid.
@ eEngine_InvalidOperation
Engine - operation is invalid.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define NCBI_GUIUTILS_EXPORT
#define NCBI_GUIOBJUTILS_EXPORT
Compressed bitset (entry point to bm.h)
SJobRecord describes a Job registered in Dispatcher.
SQueueItem - element of the Polling Queue.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4