HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
COP_SlapcompRegistry.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: Global registry of the last slapcomps.
7  *
8  */
9 
10 #pragma once
11 
12 #include "COP_API.h"
13 
14 #include "COP_Signature.h"
15 
16 #include <IMX/IMX_Layer.h>
17 #include <UT/UT_Lock.h>
18 
19 class cop_RegistryHolder;
20 
21 ///
22 /// Stores slap comp layers for other nodes to possibly retrieve
23 /// Currently only one path, ideally will allow multiple viewport
24 /// simultaneously.
25 ///
27 {
28 private:
29  struct PrivateConstructorKey {};
30  friend class cop_RegistryHolder;
31 
32 public:
33  class AovInfo
34  {
35  public:
38  };
39 
40  static IMX_LayerConstPtr fetchLayer(const char *aov);
41  static void stashLayer(const UT_StringHolder &aov,
43 
44  static void registerNode(const OP_Node *node,
45  const UT_StringSet &aovs);
46  static void deregisterNode(const OP_Node *node);
47  static void notifyNodes();
48 
49  static void registerViewerAOVs(const UT_Array<AovInfo> &aovs);
50 
51  /// Populate aovs with all aovs requested by any live
52  /// import.
53  static void activeAOVs(UT_StringSet &aovs);
54 
55  /// List of AOVs last submitted by a viewer
56  /// import.
57  static void viewerAOVs(UT_Array<AovInfo> &aovs);
58 
59  static void clear();
60 
61  COP_SlapcompRegistry(PrivateConstructorKey);
62 
63 protected:
64  static COP_SlapcompRegistry *getRegistry();
65 
66  IMX_LayerConstPtr _fetchLayer(const char *aov);
67  void _stashLayer(const UT_StringHolder &aov,
69  void _clear();
70  void _registerNode(const OP_Node *node,
71  const UT_StringSet &aovs);
72  void _deregisterNode(const OP_Node *node);
73  void _notifyNodes();
74 
75  void _registerViewerAOVs(const UT_Array<AovInfo> &aovs);
76  void _activeAOVs(UT_StringSet &aovs);
77  void _viewerAOVs(UT_Array<AovInfo> &aovs);
78 
83  exint myVersion = 0;
84  exint myNotifyVersion = 0;
85 };
86 
87 
Unsorted map container.
Definition: UT_Map.h:109
int64 exint
Definition: SYS_Types.h:125
GLenum GLuint GLint GLint layer
Definition: glcorearb.h:1299
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
UT_Map< int, UT_SharedPtr< UT_StringSet > > myOpNodes
UT_SharedPtr< const IMX_Layer > IMX_LayerConstPtr
Definition: IMX_Layer.h:27
UT_Array< AovInfo > myViewerAOVs
COP_Type
Types of basic data that are passed around a COP network.
Definition: COP_Signature.h:17
UT_StringMap< IMX_LayerConstPtr > myLayers
#define COP_API
Definition: COP_API.h:8