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

#include <PDG_PartitionHolder.h>

Public Types

using IndexMap = UT_ArrayMap< int, PDG_WorkItemIDSet >
 

Public Member Functions

 PDG_PartitionHolder (const PDG_WorkItemArray &work_item)
 Constructs a new partition holder with a list of valid work items. More...
 
bool addItemToPartition (PDG_WorkItemID id, 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, 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...
 
bool addItemToAllPartitions (PDG_WorkItem *work_item, UT_WorkBuffer &errors)
 
void setPartitionFrame (int index, fpreal frame)
 Sets the frame for the partition with the given index. More...
 
void setPartitionFrame (const UT_StringHolder &name, fpreal frame)
 Sets the frame for the partition with the given name. More...
 
const IndexMappartitions () const
 Returns the partition map. More...
 
const IndexMaprequired () const
 Returns the items that should be marked as required for each partition. More...
 
const PDG_WorkItemIDSetallSet () const
 
int maxIndex () const
 Returns the current max index of all partitions added to the holder. More...
 
int numPartitions () const
 
const UT_StringHoldersplitAttribute () const
 Returns the split attribute name. More...
 
const UT_StringHoldersplitValue () const
 Returns the current split attribute value. More...
 
bool isSplitting () const
 
const PDG_WorkItemArraysplitMissing () const
 
PDG_WorkItemArraysplitMissing ()
 
PDG_WorkItempartitionInput (PDG_WorkItemID id) const
 
PDG_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...
 
bool checkLoop (UT_WorkBuffer &errors, const PDG_WorkItemIDSet &ids, PDG_WorkItem **current_item, bool check_all) const
 
bool checkLoop (UT_WorkBuffer &errors, const PDG_WorkItemArray &work_items, PDG_WorkItem **current_item) const
 

Detailed Description

Factory/holder object that creates or updates partitions

Examples:
PDG/PDG_PartitionByParity.C, and PDG/PDG_PartitionByParity.h.

Definition at line 24 of file PDG_PartitionHolder.h.

Member Typedef Documentation

Constructor & Destructor Documentation

PDG_PartitionHolder::PDG_PartitionHolder ( const PDG_WorkItemArray work_item)

Constructs a new partition holder with a list of valid work items.

Member Function Documentation

bool PDG_PartitionHolder::addItemToAllPartitions ( PDG_WorkItem work_item,
UT_WorkBuffer errors 
)

Adds a work item to all partitions, without having to know the indices or number of partitions that exist

bool PDG_PartitionHolder::addItemToPartition ( PDG_WorkItemID  id,
int  index,
bool  required,
UT_WorkBuffer errors 
)

Adds a work item to the partition with the specified index.

Examples:
PDG/PDG_PartitionByParity.C.
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.

const PDG_WorkItemIDSet& PDG_PartitionHolder::allSet ( ) const
inline

Returns the all set, e.g. the set of items that should be added to all partitions

Definition at line 81 of file PDG_PartitionHolder.h.

bool PDG_PartitionHolder::checkLoop ( UT_WorkBuffer errors,
const PDG_WorkItemIDSet ids,
PDG_WorkItem **  current_item,
bool  check_all 
) const

Determines the loop stack work item for a set of work item IDs, and returns false if the IDs don't form a valid partition for a loop.

bool PDG_PartitionHolder::checkLoop ( UT_WorkBuffer errors,
const PDG_WorkItemArray work_items,
PDG_WorkItem **  current_item 
) const

Determines the loop stack work item for a list of work items, and return false if the items don't form a valid partition for a loop

PDG_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.

bool PDG_PartitionHolder::isSplitting ( ) const
inline

Returns true if this holder is being used for partitioning with a split attribute.

Definition at line 104 of file PDG_PartitionHolder.h.

int PDG_PartitionHolder::maxIndex ( ) const
inline

Returns the current max index of all partitions added to the holder.

Definition at line 86 of file PDG_PartitionHolder.h.

int PDG_PartitionHolder::numPartitions ( ) const
inline

Returns the number of partitions added to the holder. This is reset after setSplitValue is called.

Definition at line 91 of file PDG_PartitionHolder.h.

PDG_WorkItem* PDG_PartitionHolder::partitionInput ( PDG_WorkItemID  id) const
inline

Returns the input work item for the specifed ID, or null if the ID is not a valid input

Definition at line 116 of file PDG_PartitionHolder.h.

const IndexMap& PDG_PartitionHolder::partitions ( ) const
inline

Returns the partition map.

Definition at line 72 of file PDG_PartitionHolder.h.

const IndexMap& PDG_PartitionHolder::required ( ) const
inline

Returns the items that should be marked as required for each partition.

Definition at line 76 of file PDG_PartitionHolder.h.

void PDG_PartitionHolder::resolveNames ( )

Converts named partitions into real partitions.

void PDG_PartitionHolder::setPartitionFrame ( int  index,
fpreal  frame 
)

Sets the frame for the partition with the given index.

void PDG_PartitionHolder::setPartitionFrame ( const UT_StringHolder name,
fpreal  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.

const UT_StringHolder& PDG_PartitionHolder::splitAttribute ( ) const
inline

Returns the split attribute name.

Definition at line 95 of file PDG_PartitionHolder.h.

const PDG_WorkItemArray& PDG_PartitionHolder::splitMissing ( ) const
inline

Returns the array of work items that are missing the split attribute, or nullptr if isSplitting() returns false;

Definition at line 109 of file PDG_PartitionHolder.h.

PDG_WorkItemArray& PDG_PartitionHolder::splitMissing ( )
inline

Definition at line 111 of file PDG_PartitionHolder.h.

const UT_StringHolder& PDG_PartitionHolder::splitValue ( ) const
inline

Returns the current split attribute value.

Definition at line 99 of file PDG_PartitionHolder.h.


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