Standalone thread to execute scheduled tasks CIRef<IScheduler> scheduler = IScheduler::Create(); CScheduler_ExecutionThread execution_thread(scheduler); scheduler->AddTask(some_task, some_time);
#ifndef UTIL___SCHEDULER__HPP
#define UTIL___SCHEDULER__HPP
#include <vector>
{
public:
};
{
public:
virtual void OnNextExecutionTimeChange(
IScheduler* scheduler) = 0;
};
{
};
{
public:
virtual
const CTime& exec_time) = 0;
enum ERepeatPattern {
eWithRate,
eWithDelay
};
virtual
ERepeatPattern repeat_pattern) = 0;
virtual
virtual
virtual
void RemoveAllSeries(void) = 0;
virtual
void GetScheduledSeries(vector<SScheduler_SeriesInfo>* series) const = 0;
virtual
virtual
virtual
CTime GetNextExecutionTime(
void)
const = 0;
virtual
bool IsEmpty(void) const = 0;
virtual
bool HasTasksToExecute(
const CTime& now)
const = 0;
virtual
virtual
};
{
public:
private:
};
#endif
Standalone thread to execute scheduled tasks - implementation.
Interface to get notifications about selected changes in the scheduler timeline.
General interface for scheduled tasks.
Task scheduler interface.
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
unsigned int TScheduler_SeriesID
Type of scheduled series identifier.
string Execute(const string &cmmd, const vector< string > &args, const string &data=kEmptyStr)
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Defines: CTimeFormat - storage class for time format.
NCBI_XUTIL_EXPORT
Parameter to control printing diagnostic message about conversion of static array data from a differe...
Information about scheduled series.