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
PDGE_PropagateGroup.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 __PDGE_PROPAGATE_GROUP_H__
10
#define __PDGE_PROPAGATE_GROUP_H__
11
12
#include "
PDGE_API.h
"
13
14
#include "
PDGE_Dependency.h
"
15
#include "
PDGE_DependencyOwner.h
"
16
17
#include <
UT/UT_Array.h
>
18
#include <
UT/UT_ArrayMap.h
>
19
#include <
UT/UT_NonCopyable.h
>
20
#include <
UT/UT_TBBSpinLock.h
>
21
22
/*
23
* Provides a mechanism for a dependency owner to wait for all descendants
24
* from a given upstream dependency, without knowing what they are ahead of
25
* time. For example, this is used for targeted partitioning features and
26
* feedback loops in $PDG.
27
*/
28
class
PDGE_API
PDGE_PropagateGroup
:
UT_NonCopyable
29
{
30
public
:
31
/// Constructs a new propagate group with the specified owner. The owner
32
/// is used to when connecting this group to input groups and adding
33
/// entries that should only propagate to a certain depth or target node.
34
PDGE_PropagateGroup
(
PDGE_DependencyOwner
* owner);
35
virtual
~
PDGE_PropagateGroup
();
36
37
/// Returns the total memory usage of this propagate groiup
38
int64
getMemoryUsage(
bool
inclusive)
const
;
39
40
/// Adds a target owner to the set of targets associated with this group.
41
/// These are the owners that the group may target, and the group will not
42
/// recurse beyond them when adding dependencies.
43
inline
void
addTarget
(
PDGE_DependencyOwner
*
target
)
44
{ myTargetOwners.insert(target); }
45
46
/// Adds an input group to this propagate group. Dependencies are added
47
/// on input group entries, and propagate back down to this group during
48
/// evaluation.
49
inline
void
addInputGroup
(
PDGE_PropagateGroup
* input_group)
50
{ myInputGroups.append(input_group); }
51
52
/// Resets the propagate group. This will free all owned dependencies and
53
/// clear all structures including input groups and targets.
54
void
reset
(
PDGE_Dependency
* extra_dependency);
55
56
/// Adds an propagation entry to this group. The entry must have a target
57
/// owner and a root dependency. Optionally, an additional dependent can
58
/// be passed that will automatically be made to depend on the new entry.
59
///
60
/// The root is the source dependency for which the entry is associated
61
/// with. The entry will wait for the root and all of its descendants
62
/// between the target owner and this group.
63
void
addEntry(
64
PDGE_DependencyOwner
*
target
,
65
PDGE_Dependency
* root,
66
PDGE_Dependency
* dependent);
67
68
/// Copies relevant propagate depenencies from source onto the specified
69
/// downstream dependent, based on what propagate entries exist in this map.
70
void
propagateDependencies(
71
PDGE_Dependency
*
source
,
72
PDGE_Dependency
* destination);
73
74
/// Returns the list of dependency owners for a propagate dependency owned
75
/// by this group.
76
void
upstreamOwners(
77
PDGE_DependencyOwner::Array
& owners,
78
PDGE_Dependency
* dependency)
const
;
79
80
/// Returns the root owner for a propagate dependency owned by this group
81
PDGE_DependencyOwner
* rootOwner(
PDGE_Dependency
* dependent)
const
;
82
83
private
:
84
using
Array
=
UT_Array<PDGE_PropagateGroup*>
;
85
using
Map =
UT_ArrayMap<PDGE_Dependency*, PDGE_Dependency*>
;
86
87
void
propagateInternal(
PDGE_Dependency
*
source
,
88
PDGE_Dependency
* destination);
89
PDGE_Dependency
* addEntryInternal(
90
PDGE_DependencyOwner
*
target
,
91
const
PDGE_DependencyOwner::Set
& targets,
92
PDGE_Dependency
* root,
93
PDGE_Dependency
* dependent);
94
PDGE_Dependency
* addEntryInternal(
95
PDGE_Dependency
* root);
96
private
:
97
Array
myInputGroups;
98
Map myPropagateDependencies;
99
Map myDependents;
100
PDGE_DependencyOwner::Set
myTargetOwners;
101
PDGE_DependencyOwner
* myOwner;
102
PDGE_Dependency
* myExtraDependency;
103
mutable
UT_TBBSpinLock
myLock;
104
};
105
106
#endif
UT::ArraySet
Definition:
UT_ArraySet.h:167
Array
Definition:
ImfArray.h:45
PDGE_API.h
UT_Lockable< tbb::spin_mutex >
UT_Array.h
UT_Array
Definition:
BV_KDOPTree.h:18
UT::ArrayMap
Definition:
UT_ArrayMap.h:85
UT_TBBSpinLock.h
PDGE_DependencyOwner.h
reset
GLboolean reset
Definition:
glad.h:5138
PDGE_Dependency
Definition:
PDGE_Dependency.h:53
source
GLsizei GLsizei GLchar * source
Definition:
glcorearb.h:803
PDGE_Dependency.h
int64
long long int64
Definition:
SYS_Types.h:116
target
GLenum target
Definition:
glcorearb.h:1667
PDGE_DependencyOwner
Definition:
PDGE_DependencyOwner.h:26
UT_NonCopyable.h
PDGE_PropagateGroup
Definition:
PDGE_PropagateGroup.h:28
UT_ArrayMap.h
PDGE_API
#define PDGE_API
Definition:
PDGE_API.h:23
UT_NonCopyableNS::UT_NonCopyable
Definition:
UT_NonCopyable.h:17
PDGE_PropagateGroup::addInputGroup
void addInputGroup(PDGE_PropagateGroup *input_group)
Definition:
PDGE_PropagateGroup.h:49
PDGE_PropagateGroup::addTarget
void addTarget(PDGE_DependencyOwner *target)
Definition:
PDGE_PropagateGroup.h:43
PDGE
PDGE_PropagateGroup.h
Generated on Sat Dec 21 2024 02:47:29 for HDK by
1.8.6