Games Task Scheduler (GTS)
A multi-processor scheduling framework for games engines
gts::Schedule Class Referenceabstract

The execution schedule for all ComputeResources. More...

#include <Schedule.h>

Inherited by gts::CentralQueue_Schedule, and gts::CriticalNode_Schedule.

Public Member Functions

GTS_INLINE Schedule (MacroScheduler *pMyScheduler)
 
virtual ~Schedule ()=default
 
GTS_INLINE MacroSchedulergetScheduler ()
 
GTS_INLINE int32_t refCount () const
 
virtual NodepopNextNode (ComputeResource *pComputeResource, bool myQueuesOnly)=0
 
virtual bool isDone () const =0
 
GTS_INLINE int32_t addRef (uint32_t refCount)
 
GTS_INLINE uint32_t removeRef (uint32_t refCount)
 
virtual void tryMarkDone (Node *pNode)=0
 
virtual void insertReadyNode (Node *pNode)=0
 
virtual void observeExecutionCost (ComputeResourceId, uint64_t)
 

Detailed Description

The execution schedule for all ComputeResources.

Constructor & Destructor Documentation

◆ ~Schedule()

virtual gts::Schedule::~Schedule ( )
virtualdefault

For polymorphic destruction.

Member Function Documentation

◆ addRef()

GTS_INLINE int32_t gts::Schedule::addRef ( uint32_t  refCount)
inline

Adds refCount to the current reference count.

Returns
The new reference count.

◆ getScheduler()

GTS_INLINE MacroScheduler* gts::Schedule::getScheduler ( )
inline
Returns
The MacroScheduler that created this Schedule.

◆ insertReadyNode()

virtual void gts::Schedule::insertReadyNode ( Node pNode)
pure virtual

Insert 'pNode' into the schedule.

Implemented in gts::CentralQueue_Schedule, and gts::CriticalNode_Schedule.

◆ isDone()

virtual bool gts::Schedule::isDone ( ) const
pure virtual
Returns
True if the schedule is completed.

Implemented in gts::CentralQueue_Schedule, and gts::CriticalNode_Schedule.

◆ observeExecutionCost()

virtual void gts::Schedule::observeExecutionCost ( ComputeResourceId  ,
uint64_t   
)
inlinevirtual

Share the current Node's execution cost on the specified compute resource.

◆ popNextNode()

virtual Node* gts::Schedule::popNextNode ( ComputeResource pComputeResource,
bool  myQueuesOnly 
)
pure virtual
Returns
The next Node for the ComputeResource to execute.

Implemented in gts::CentralQueue_Schedule, and gts::CriticalNode_Schedule.

◆ refCount()

GTS_INLINE int32_t gts::Schedule::refCount ( ) const
inline
Returns
The current reference count.

◆ removeRef()

GTS_INLINE uint32_t gts::Schedule::removeRef ( uint32_t  refCount)
inline

Removes refCount from the current reference count.

Returns
The new reference count.

◆ tryMarkDone()

virtual void gts::Schedule::tryMarkDone ( Node pNode)
pure virtual

If 'pNode' is the last Node, mark the schedule as done.

Implemented in gts::CentralQueue_Schedule, and gts::CriticalNode_Schedule.