HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_WorkItemSort Class Reference

#include <PDG_WorkItemSort.h>

Public Types

template<bool Reverse = false>
using Priority = Comparator< PriorityComparator, Reverse >
 Functor that compares two work item references or pointers by priority. More...
 
template<bool Reverse = false>
using Index = Comparator< IndexComparator, Reverse >
 Functor for comparing work items for sorting by index. More...
 
template<bool Reverse = false>
using IndexInput = Comparator< IndexComparator, Reverse, const PDG_NodeArray * >
 Functor for comparing work items for sorting by index and node. More...
 
template<bool Reverse = false>
using Input = Comparator< InputComparator, Reverse, const PDG_NodeArray * >
 
template<bool Reverse = false>
using Attribute = Comparator< AttributeComparator, Reverse, const PDG_AttributeEvaluator * >
 Compares work items using an attribute. More...
 
template<bool Reverse = false>
using Frame = Comparator< FrameComparator, Reverse, const PDG_NodeArray * >
 Compars work items using their frame value. More...
 

Static Public Member Functions

template<typename Array >
static void sortItems (Array &work_items)
 Sorts the work items based on index, in ascending order. More...
 
template<typename Array >
static void sortItems (Array &work_items, const PDG_Node *target_node, const PDG_WorkItemConstBoolMap *required_items)
 
template<typename Array >
static void sortItems (Array &work_items, const PDG_SortOptions &sort_options, const PDG_WorkItemConstBoolMap *required_items, const PDG_NodeArray *inputs)
 Sorts the work items based on a sort options struct. More...
 

Detailed Description

Utility functors for sorting work items. All functors can be used for both ascending or descending order, as determined by the "reverse" parameter passed during construction. They default to ascending order for compatibility with the standard C++ std::sort/less-than comparator.

It is also possible to statically create a reversed comparator using the reverse template argument. This is useful when defining datastructures that need to use one of the comparators as a template argument for ordering, e.g. a Priority Queue.

Definition at line 32 of file PDG_WorkItemSort.h.

Member Typedef Documentation

template<bool Reverse = false>
using PDG_WorkItemSort::Attribute = Comparator<AttributeComparator, Reverse, const PDG_AttributeEvaluator*>

Compares work items using an attribute.

Definition at line 197 of file PDG_WorkItemSort.h.

template<bool Reverse = false>
using PDG_WorkItemSort::Frame = Comparator<FrameComparator, Reverse, const PDG_NodeArray*>

Compars work items using their frame value.

Definition at line 201 of file PDG_WorkItemSort.h.

template<bool Reverse = false>
using PDG_WorkItemSort::Index = Comparator<IndexComparator, Reverse>

Functor for comparing work items for sorting by index.

Definition at line 181 of file PDG_WorkItemSort.h.

template<bool Reverse = false>
using PDG_WorkItemSort::IndexInput = Comparator<IndexComparator, Reverse, const PDG_NodeArray*>

Functor for comparing work items for sorting by index and node.

Definition at line 186 of file PDG_WorkItemSort.h.

template<bool Reverse = false>
using PDG_WorkItemSort::Input = Comparator<InputComparator, Reverse, const PDG_NodeArray*>

Functor for comparing work items for sorting by input number. Fallback to index when the input is the same.

Definition at line 192 of file PDG_WorkItemSort.h.

template<bool Reverse = false>
using PDG_WorkItemSort::Priority = Comparator<PriorityComparator, Reverse>

Functor that compares two work item references or pointers by priority.

Definition at line 177 of file PDG_WorkItemSort.h.

Member Function Documentation

template<typename Array >
static void PDG_WorkItemSort::sortItems ( Array work_items)
inlinestatic

Sorts the work items based on index, in ascending order.

Definition at line 207 of file PDG_WorkItemSort.h.

template<typename Array >
static void PDG_WorkItemSort::sortItems ( Array work_items,
const PDG_Node target_node,
const PDG_WorkItemConstBoolMap required_items 
)
inlinestatic

Sorts the work items based on the sort preferences of the specified node

Definition at line 216 of file PDG_WorkItemSort.h.

template<typename Array >
static void PDG_WorkItemSort::sortItems ( Array work_items,
const PDG_SortOptions sort_options,
const PDG_WorkItemConstBoolMap required_items,
const PDG_NodeArray inputs 
)
inlinestatic

Sorts the work items based on a sort options struct.

Definition at line 233 of file PDG_WorkItemSort.h.


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