HDK
|
#include <PDG_PartitionHolder.h>
Public Types | |
using | IndexMap = UT_ArrayMap< int, PDG_WorkItemSet > |
Public Member Functions | |
PDG_PartitionHolder () | |
Constructs a new partition holder. More... | |
bool | addItemToPartition (PDG_WorkItem *work_item, int index, bool required, UT_WorkBuffer &errors) |
Adds a work item to the partition with the specified index. More... | |
bool | addItemToPartition (PDG_WorkItem *work_item, const UT_StringHolder &name, bool required, UT_WorkBuffer &errors) |
Adds a work item to the partition with the specified name. More... | |
void | addItemToAllPartitions (PDG_WorkItem *work_item) |
void | setPartitionFrame (int index, OptionalFrame frame) |
Sets the frame for the partition with the given index. More... | |
void | setPartitionFrame (const UT_StringHolder &name, OptionalFrame frame) |
Sets the frame for the partition with the given name. More... | |
const IndexMap & | partitions () const |
Returns the partition map. More... | |
const IndexMap & | required () const |
Returns the items that should be marked as required for each partition. More... | |
const PDG_WorkItemSet & | allSet () const |
int | maxIndex () const |
Returns the current max index of all partitions added to the holder. More... | |
int | numPartitions () const |
const UT_StringHolder & | splitAttribute () const |
Returns the split attribute name. More... | |
const UT_StringHolder & | splitValue () const |
Returns the current split attribute value. More... | |
bool | isSplitting () const |
const PDG_WorkItemArray & | splitMissing () const |
PDG_WorkItemArray & | splitMissing () |
OptionalFrame | frameForPartition (int index) const |
Return the frame specified for the partition with the given index. More... | |
bool | isAllSetOnly () const |
Returns true if the holder only consists of entries in the All Set. More... | |
void | setSplitInfo (const UT_StringHolder &name) |
void | setSplitValue (const UT_StringHolder &value, int index_offset) |
void | resolveNames () |
Converts named partitions into real partitions. More... | |
Factory/holder object that creates or updates partitions
Definition at line 25 of file PDG_PartitionHolder.h.
Definition at line 28 of file PDG_PartitionHolder.h.
PDG_PartitionHolder::PDG_PartitionHolder | ( | ) |
Constructs a new partition holder.
void PDG_PartitionHolder::addItemToAllPartitions | ( | PDG_WorkItem * | work_item | ) |
Adds a work item to all partitions, without having to know the indices or number of partitions that exist
bool PDG_PartitionHolder::addItemToPartition | ( | PDG_WorkItem * | work_item, |
int | index, | ||
bool | required, | ||
UT_WorkBuffer & | errors | ||
) |
Adds a work item to the partition with the specified index.
bool PDG_PartitionHolder::addItemToPartition | ( | PDG_WorkItem * | work_item, |
const UT_StringHolder & | name, | ||
bool | required, | ||
UT_WorkBuffer & | errors | ||
) |
Adds a work item to the partition with the specified name.
|
inline |
Returns the all set, e.g. the set of items that should be added to all partitions
Definition at line 72 of file PDG_PartitionHolder.h.
OptionalFrame PDG_PartitionHolder::frameForPartition | ( | int | index | ) | const |
Return the frame specified for the partition with the given index.
bool PDG_PartitionHolder::isAllSetOnly | ( | ) | const |
Returns true if the holder only consists of entries in the All Set.
|
inline |
Returns true if this holder is being used for partitioning with a split attribute.
Definition at line 95 of file PDG_PartitionHolder.h.
|
inline |
Returns the current max index of all partitions added to the holder.
Definition at line 77 of file PDG_PartitionHolder.h.
|
inline |
Returns the number of partitions added to the holder. This is reset after setSplitValue is called.
Definition at line 82 of file PDG_PartitionHolder.h.
Returns the partition map.
Definition at line 63 of file PDG_PartitionHolder.h.
Returns the items that should be marked as required for each partition.
Definition at line 67 of file PDG_PartitionHolder.h.
void PDG_PartitionHolder::resolveNames | ( | ) |
Converts named partitions into real partitions.
void PDG_PartitionHolder::setPartitionFrame | ( | int | index, |
OptionalFrame | frame | ||
) |
Sets the frame for the partition with the given index.
void PDG_PartitionHolder::setPartitionFrame | ( | const UT_StringHolder & | name, |
OptionalFrame | frame | ||
) |
Sets the frame for the partition with the given name.
void PDG_PartitionHolder::setSplitInfo | ( | const UT_StringHolder & | name | ) |
Sets the global split attribute information for this holder. Called once during partitioning with a split attribute.
void PDG_PartitionHolder::setSplitValue | ( | const UT_StringHolder & | value, |
int | index_offset | ||
) |
Sets the local split attribute information for this holder. Called once for each split attribute value during partitioning.
|
inline |
Returns the split attribute name.
Definition at line 86 of file PDG_PartitionHolder.h.
|
inline |
Returns the array of work items that are missing the split attribute, or nullptr if isSplitting() returns false;
Definition at line 100 of file PDG_PartitionHolder.h.
|
inline |
Definition at line 102 of file PDG_PartitionHolder.h.
|
inline |
Returns the current split attribute value.
Definition at line 90 of file PDG_PartitionHolder.h.