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

#include <PDG_AttributeMerge.h>

+ Inheritance diagram for PDG_AttributeMerge:

Classes

struct  MergeData
 

Public Types

enum  AttribType { eAttribRegular = 0x01, eAttribInput = 0x02, eAttribOutput = 0x04, eAttribAll = 0x07 }
 Enumeration of types of data types to merge. More...
 
enum  AttribFlatten { eAttribFlattenNever, eAttribFlattenAlways, eAttribFlattenContext }
 
using Pattern = UT_Array< UT_UniquePtr< MergeData >>
 A collection of merge patterns. More...
 

Public Member Functions

 PDG_AttributeMerge (int attribute_types, const Pattern &pattern=theEmptyPattern, bool is_deep=false)
 
int attribTypes () const
 Returns the attribute type filter. More...
 
bool isDeep () const
 Returns true if merging should always do a deep copy of attribs. More...
 
bool isInternalDependent () const
 
PDG_AttributeCollision attribCollision () const
 Returns the attribute collision strategy. More...
 
void setAttribFlatten (AttribFlatten flatten)
 Sets the attribute flatten mode. More...
 
void setDefaultMerge (PDG_AttributeMergeOp merge_op)
 Sets the default merge operation. More...
 
void setInputMerge (PDG_AttributeMergeOp merge_op)
 Adds a merge type for input files. More...
 
void setOutputMerge (PDG_AttributeMergeOp merge_op)
 Adds a merge type for output files. More...
 
void setIsMergeAdded (bool merge_added)
 Sets the is merge added flag. More...
 
void setAttribCollision (PDG_AttributeCollision strategy)
 
void addForceIgnore (const UT_StringHolder &name)
 Adds an attibute name to the list of forced ignore attributes. More...
 
void setIsInternalDependent (bool dependent)
 
bool isMergeFlatten () const
 
bool isMergeAdded () const
 
void reportErrors (PDG_Node *node) const
 

Static Public Member Functions

static bool arePatternsEqual (const Pattern &left, const Pattern &right)
 Compares two patterns for equality. More...
 

Static Public Attributes

static const Pattern theEmptyPattern
 The default, empty merge pattern. More...
 

Friends

class PDG_AttributeMap
 

Detailed Description

Utility class for merging work item attributes. Stores a list of patterns and operations that determine how attributes should be merged. The array order determines the order the patterns are applied.

Definition at line 34 of file PDG_AttributeMerge.h.

Member Typedef Documentation

A collection of merge patterns.

Definition at line 96 of file PDG_AttributeMerge.h.

Member Enumeration Documentation

Enumeration of different flatten operations, which determines if the dynamic and static attribute maps of the source should be combined.

Enumerator
eAttribFlattenNever 

Never flatten the attribute maps.

eAttribFlattenAlways 

Always flatten the attribute maps.

eAttribFlattenContext 

Use the context runtime state to determine if the maps should be flattened

Definition at line 58 of file PDG_AttributeMerge.h.

Enumeration of types of data types to merge.

Enumerator
eAttribRegular 

Merge operation should include regular attributes, which are all attributes except for inputs and outputs.

eAttribInput 

Merge operation should copy incoming output files to the dest map's input file attrib

eAttribOutput 

Merge operation should copy incoming output files to the dest map's output file attrib

eAttribAll 

Convenience value for merging all attribute types.

Definition at line 38 of file PDG_AttributeMerge.h.

Constructor & Destructor Documentation

PDG_AttributeMerge::PDG_AttributeMerge ( int  attribute_types,
const Pattern pattern = theEmptyPattern,
bool  is_deep = false 
)

Constructs a new attribute merge operation from the specified merge types, operation and is_deep flag

Member Function Documentation

void PDG_AttributeMerge::addForceIgnore ( const UT_StringHolder name)
inline

Adds an attibute name to the list of forced ignore attributes.

Definition at line 156 of file PDG_AttributeMerge.h.

static bool PDG_AttributeMerge::arePatternsEqual ( const Pattern left,
const Pattern right 
)
static

Compares two patterns for equality.

PDG_AttributeCollision PDG_AttributeMerge::attribCollision ( ) const
inline

Returns the attribute collision strategy.

Definition at line 123 of file PDG_AttributeMerge.h.

int PDG_AttributeMerge::attribTypes ( ) const
inline

Returns the attribute type filter.

Definition at line 110 of file PDG_AttributeMerge.h.

bool PDG_AttributeMerge::isDeep ( ) const
inline

Returns true if merging should always do a deep copy of attribs.

Definition at line 114 of file PDG_AttributeMerge.h.

bool PDG_AttributeMerge::isInternalDependent ( ) const
inline

Returns true if the merge operation is between dependents within the same node

Definition at line 119 of file PDG_AttributeMerge.h.

bool PDG_AttributeMerge::isMergeAdded ( ) const

Returns true if the merge should also included added files when merging outputs, which is typically only used during deseralization

bool PDG_AttributeMerge::isMergeFlatten ( ) const

Returns true if the merge should flatten the dynamic and static attribute maps into a single table

void PDG_AttributeMerge::reportErrors ( PDG_Node node) const

Reports warnings on the specified node from the merge errors recorded in the map

void PDG_AttributeMerge::setAttribCollision ( PDG_AttributeCollision  strategy)
inline

Sets the collision strategy, used when an existing attribute is found and a decision needs to be made about overwrting it.

Definition at line 151 of file PDG_AttributeMerge.h.

void PDG_AttributeMerge::setAttribFlatten ( AttribFlatten  flatten)
inline

Sets the attribute flatten mode.

Definition at line 127 of file PDG_AttributeMerge.h.

void PDG_AttributeMerge::setDefaultMerge ( PDG_AttributeMergeOp  merge_op)
inline

Sets the default merge operation.

Definition at line 131 of file PDG_AttributeMerge.h.

void PDG_AttributeMerge::setInputMerge ( PDG_AttributeMergeOp  merge_op)
inline

Adds a merge type for input files.

Definition at line 136 of file PDG_AttributeMerge.h.

void PDG_AttributeMerge::setIsInternalDependent ( bool  dependent)
inline

Sets a flag that indicates this merge is being applied to work items from the same node

Definition at line 161 of file PDG_AttributeMerge.h.

void PDG_AttributeMerge::setIsMergeAdded ( bool  merge_added)
inline

Sets the is merge added flag.

Definition at line 146 of file PDG_AttributeMerge.h.

void PDG_AttributeMerge::setOutputMerge ( PDG_AttributeMergeOp  merge_op)
inline

Adds a merge type for output files.

Definition at line 141 of file PDG_AttributeMerge.h.

Friends And Related Function Documentation

friend class PDG_AttributeMap
friend

Definition at line 208 of file PDG_AttributeMerge.h.

Member Data Documentation

const Pattern PDG_AttributeMerge::theEmptyPattern
static

The default, empty merge pattern.

Definition at line 99 of file PDG_AttributeMerge.h.


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