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_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 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_WorkItemSetallSet () 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 ()
 
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...
 

Detailed Description

Factory/holder object that creates or updates partitions

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

Definition at line 25 of file PDG_PartitionHolder.h.

Member Typedef Documentation

Constructor & Destructor Documentation

PDG_PartitionHolder::PDG_PartitionHolder ( )

Constructs a new partition holder.

Member Function Documentation

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.

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

bool PDG_PartitionHolder::isSplitting ( ) const
inline

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

Definition at line 95 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 77 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 82 of file PDG_PartitionHolder.h.

const IndexMap& PDG_PartitionHolder::partitions ( ) const
inline

Returns the partition map.

Definition at line 63 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 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.

const UT_StringHolder& PDG_PartitionHolder::splitAttribute ( ) const
inline

Returns the split attribute name.

Definition at line 86 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 100 of file PDG_PartitionHolder.h.

PDG_WorkItemArray& PDG_PartitionHolder::splitMissing ( )
inline

Definition at line 102 of file PDG_PartitionHolder.h.

const UT_StringHolder& PDG_PartitionHolder::splitValue ( ) const
inline

Returns the current split attribute value.

Definition at line 90 of file PDG_PartitionHolder.h.


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