HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
PDG_AttributeClassify.h
Go to the documentation of this file.
1
/*
2
* PROPRIETARY INFORMATION. This software is proprietary to
3
* Side Effects Software Inc., and is not to be reproduced,
4
* transmitted, or disclosed in any way without written permission.
5
*
6
* COMMENTS:
7
*/
8
9
#ifndef __PDG_ATTRIBUTE_CLASSIFY_H__
10
#define __PDG_ATTRIBUTE_CLASSIFY_H__
11
12
#include "
PDG_API.h
"
13
14
#include "
PDG_WorkItemTypes.h
"
15
16
#include <
UT/UT_Array.h
>
17
#include <
UT/UT_ArrayMap.h
>
18
#include <
UT/UT_VectorTypes.h
>
19
#include <
UT/UT_WorkBuffer.h
>
20
21
#include <
SYS/SYS_Hash.h
>
22
23
class
PDG_WorkItem
;
24
25
class
UT_StringArray
;
26
27
/*
28
* Groups work items into separate classes based on their attributes
29
*/
30
class
PDG_API
PDG_AttributeClassify
31
{
32
public
:
33
/// A map of attribute hash to the work items that match that particular
34
/// class.
35
using
AttributeMap
=
UT_ArrayMap<SYS_HashType, PDG_WorkItemIDArray>
;
36
37
/// A map of work item ID to the monotonically increasing class numbers
38
/// that the work item is a part of
39
using
ClassMap
=
UT_ArrayMap<PDG_WorkItemID, UT_ExintArray>
;
40
41
public
:
42
/// Returns the immediate results of classification, as a map of attrib
43
/// hash to the matching work items
44
const
AttributeMap
&
classifications
()
const
45
{
return
myClassifications; }
46
47
/// Returns the number of unique classifiction keys found from the input
48
/// work items
49
exint
numKeys
()
const
50
{
return
myClassificationKeys.size(); }
51
52
/// Returns a map of work item ID to class, produced by post-processing the
53
/// classification map
54
void
classifications(ClassMap& class_map)
const
;
55
56
/// Classifies the work item by creating a unique classification for ALL
57
/// attribute names. Returns true if the work item has the desired set of
58
/// attributes, and false if the work item is missing an attribute.
59
bool
classifyAll(
60
const
UT_StringArray
& names,
61
const
PDG_WorkItem
* work_item,
62
bool
skip_failures,
63
UT_WorkBuffer
& errors);
64
65
/// Classifies the work item by creating a unique classification for EACH
66
/// attribute name. Returns true if the work items has the desired set of
67
/// attributes, and false if the work items is missing an attribute.
68
bool
classifyEach(
69
const
UT_StringArray
& names,
70
const
PDG_WorkItem
* work_item,
71
bool
skip_failures,
72
UT_WorkBuffer
& errors);
73
74
private
:
75
AttributeMap myClassifications;
76
UT_Array<SYS_HashType>
myClassificationKeys;
77
};
78
79
#endif
PDG_AttributeClassify
Definition:
PDG_AttributeClassify.h:30
UT_WorkBuffer
Definition:
UT_WorkBuffer.h:74
PDG_API
#define PDG_API
Definition:
PDG_API.h:23
exint
int64 exint
Definition:
SYS_Types.h:125
SYS_Hash.h
UT_Array.h
UT_Array< SYS_HashType >
UT::ArrayMap
Definition:
UT_ArrayMap.h:85
UT_StringArray
Definition:
UT_StringArray.h:24
UT_WorkBuffer.h
UT_VectorTypes.h
PDG_AttributeClassify::numKeys
exint numKeys() const
Definition:
PDG_AttributeClassify.h:49
PDG_WorkItem
Definition:
PDG_WorkItem.h:46
PDG_API.h
UT_ArrayMap.h
PDG_AttributeClassify::classifications
const AttributeMap & classifications() const
Definition:
PDG_AttributeClassify.h:44
PDG_WorkItemTypes.h
PDG
PDG_AttributeClassify.h
Generated on Thu Sep 4 2025 02:38:21 for HDK by
1.8.6