HTGS
v2.0
The Hybrid Task Graph Scheduler
|
Class to hold any type of data. More...
#include <htgs/api/IData.hpp>
Public Member Functions | |
IData () | |
Constructs an IData with default ordering = 0. | |
IData (size_t order) | |
Constructs IData with integer ordering. More... | |
virtual | ~IData () |
Destructor. | |
bool | operator() (const std::shared_ptr< IData > p1, const std::shared_ptr< IData > p2) const |
Compares two IData pointers for ordering. More... | |
virtual bool | compare (const std::shared_ptr< IData > p2) const |
Virtual IData comparison function, can be used for custom ordering. More... | |
size_t | getOrder () const |
Gets the order of this IData. More... | |
Private Attributes | |
size_t | order |
The ordering of the data (lowest first) | |
Class to hold any type of data.
Defines custom types of data that is used for data entering/leaving task graphs. All task's input and output types must derive from IData. IData can store any type of data.
One common usage is to store MemoryData within IData to be passed between tasks and released later.
Ordering can be used to specify the order of a task's priority queue (lowest value is first).
(Optional) You can customize the ordering to your specifications by overriding the following function:
Example implementation:
|
inline |
Constructs IData with integer ordering.
order | the order in which a task will process the data (lowest value is processed first) |
|
inlinevirtual |
Virtual IData comparison function, can be used for custom ordering.
Compares the current IData with another IData to determine ordering. By default, uses the order to determine the ordering. The higher the order value, the higher the priority.
p2 | the other compared IData |
TRUE | p2 is ahead of this |
FALSE | this is ahead of p2 |
|
inline |
Gets the order of this IData.