RDK Documentation (Open Sourced RDK Components)
AampScheduler Class Reference

Scheduler class for asynchronous operations. More...

#include <AampScheduler.h>

Inheritance diagram for AampScheduler:
Inheritance graph
Collaboration diagram for AampScheduler:
Collaboration graph

Public Member Functions

 AampScheduler ()
 AampScheduler Constructor.
 
 AampScheduler (const AampScheduler &)=delete
 
AampScheduleroperator= (const AampScheduler &)=delete
 
virtual ~AampScheduler ()
 AampScheduler Destructor.
 
int ScheduleTask (AsyncTaskObj obj)
 To schedule a task to be executed later. More...
 
void RemoveAllTasks ()
 To remove all scheduled tasks and prevent further tasks from scheduling. More...
 
bool RemoveTask (int id)
 To remove a scheduled tasks with ID. More...
 
void StartScheduler ()
 To start scheduler thread. More...
 
void StopScheduler ()
 To stop scheduler and associated resources. More...
 
void SuspendScheduler ()
 To acquire execution lock for synchronisation purposes. More...
 
void ResumeScheduler ()
 To release execution lock. More...
 
void EnableScheduleTask ()
 To enable scheduler to queue new tasks. More...
 
void SetState (PrivAAMPState sstate)
 To player state to Scheduler. More...
 
void SetLogger (AampLogManager *logObj)
 Set the logger instance for the Scheduler. More...
 

Protected Member Functions

void ExecuteAsyncTask ()
 Executes scheduled tasks - invoked by thread. More...
 

Protected Attributes

AampLogManagermLogObj
 
std::deque< AsyncTaskObjmTaskQueue
 
std::mutex mQMutex
 
std::condition_variable mQCond
 
bool mSchedulerRunning
 
std::thread mSchedulerThread
 
std::mutex mExMutex
 
std::unique_lock< std::mutex > mExLock
 
int mNextTaskId
 
int mCurrentTaskId
 
bool mLockOut
 
PrivAAMPState mState
 

yes

Scheduler class for asynchronous operations.

Definition at line 86 of file AampScheduler.h.

Member Function Documentation

◆ ScheduleTask()

int AampScheduler::ScheduleTask ( AsyncTaskObj  obj)

To schedule a task to be executed later.

Parameters
[in]obj- object to be scheduled
Returns
int - scheduled task id

Definition at line 64 of file AampScheduler.cpp.

◆ RemoveAllTasks()

void AampScheduler::RemoveAllTasks ( )

To remove all scheduled tasks and prevent further tasks from scheduling.

Returns
void

Definition at line 156 of file AampScheduler.cpp.

◆ RemoveTask()

bool AampScheduler::RemoveTask ( int  id)

To remove a scheduled tasks with ID.

Parameters
[in]id- ID of task to be removed
Returns
bool true if removed, false otherwise

Definition at line 218 of file AampScheduler.cpp.

◆ StartScheduler()

void AampScheduler::StartScheduler ( )

To start scheduler thread.

Returns
void

Definition at line 52 of file AampScheduler.cpp.

◆ StopScheduler()

void AampScheduler::StopScheduler ( )

To stop scheduler and associated resources.

Returns
void

Definition at line 173 of file AampScheduler.cpp.

◆ SuspendScheduler()

void AampScheduler::SuspendScheduler ( )

To acquire execution lock for synchronisation purposes.

Returns
void

Definition at line 198 of file AampScheduler.cpp.

◆ ResumeScheduler()

void AampScheduler::ResumeScheduler ( )

To release execution lock.

Returns
void

Definition at line 208 of file AampScheduler.cpp.

◆ EnableScheduleTask()

AampScheduler::EnableScheduleTask ( )

To enable scheduler to queue new tasks.

Returns
void

Definition at line 245 of file AampScheduler.cpp.

◆ SetState()

void AampScheduler::SetState ( PrivAAMPState  sstate)

To player state to Scheduler.

Returns
void

Definition at line 254 of file AampScheduler.cpp.

◆ SetLogger()

void AampScheduler::SetLogger ( AampLogManager logObj)
inline

Set the logger instance for the Scheduler.

Returns
void

Definition at line 169 of file AampScheduler.h.

◆ ExecuteAsyncTask()

AampScheduler::ExecuteAsyncTask ( )
protected

Executes scheduled tasks - invoked by thread.

Returns
void

Definition at line 102 of file AampScheduler.cpp.

Field Documentation

◆ mTaskQueue

std::deque<AsyncTaskObj> AampScheduler::mTaskQueue
protected

Queue for storing scheduled tasks

Definition at line 184 of file AampScheduler.h.

◆ mQMutex

std::mutex AampScheduler::mQMutex
protected

Mutex for accessing mTaskQueue

Definition at line 185 of file AampScheduler.h.

◆ mQCond

std::condition_variable AampScheduler::mQCond
protected

To notify when a task is queued in mTaskQueue

Definition at line 186 of file AampScheduler.h.

◆ mSchedulerRunning

bool AampScheduler::mSchedulerRunning
protected

Flag denotes if scheduler thread is running

Definition at line 187 of file AampScheduler.h.

◆ mSchedulerThread

std::thread AampScheduler::mSchedulerThread
protected

Scheduler thread

Definition at line 188 of file AampScheduler.h.

◆ mExMutex

std::mutex AampScheduler::mExMutex
protected

Execution mutex for synchronization

Definition at line 189 of file AampScheduler.h.

◆ mExLock

std::unique_lock<std::mutex> AampScheduler::mExLock
protected

Lock to be used by SuspendScheduler and ResumeScheduler

Definition at line 190 of file AampScheduler.h.

◆ mNextTaskId

int AampScheduler::mNextTaskId
protected

counter that holds ID value of next task to be scheduled

Definition at line 191 of file AampScheduler.h.

◆ mCurrentTaskId

int AampScheduler::mCurrentTaskId
protected

ID of current executed task

Definition at line 192 of file AampScheduler.h.

◆ mLockOut

bool AampScheduler::mLockOut
protected

flag indicates if the queue is locked out or not

Definition at line 193 of file AampScheduler.h.

◆ mState

PrivAAMPState AampScheduler::mState
protected

Player State

Definition at line 194 of file AampScheduler.h.


The documentation for this class was generated from the following files: