HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_AttributeEvaluator.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_EVALUATOR_H__
10 #define __PDG_ATTRIBUTE_EVALUATOR_H__
11 
12 #include "PDG_API.h"
13 
14 #include "PDG_AttributeQuery.h"
15 #include "PDG_AttributeTypes.h"
16 
18 #include <UT/UT_StringHolder.h>
19 
20 class PDG_AttributeOwner;
22 class PDG_Node;
23 class PDG_WorkItem;
24 
25 /**
26  * Caches an attribute name and component, for use with @ expression in HScript
27  */
29 {
30 public:
31  PDG_AttributeEvaluator(const char* name);
33  const char* name,
34  int component);
37  int component);
38  ~PDG_AttributeEvaluator() override;
39 
40  // Note that these are not the proper overrides for the virtual
41  // evaluateF and evaluateS methods. Because PDG is built before CH,
42  // we have to be passed the current frame number by a wrapper
43  // UT_AttributeEvaluator subclass defined in OP.
44  bool evaluateAtFrameF(fpreal frame, int thread,
45  fpreal &result,
46  EvalDiagnostics &diagnostics) const;
47  bool evaluateAtFrameS(fpreal frame, int thread,
48  UT_StringHolder &result,
49  EvalDiagnostics &diagnostics) const;
50  bool isStringValue() const override;
51 
52  PDG_AttributeIntrinsic attributeType() const;
53  void setMetadata(const UT_StringHolder& tag,
54  bool localize,
55  bool all_values);
56 
57  bool isLocalize() const
58  { return myIsLocalize; }
59  bool isAllValues() const
60  { return myIsAllValues; }
61  const UT_StringHolder& tag() const
62  { return myTag; }
63  const PDG_AttributeQuery&
64  query() const
65  { return myQuery; }
66 
67  void setWrapperEvaluator(UT_AttributeEvaluator *wrapper);
68  UT_AttributeEvaluator *wrapperEvaluator() const;
69  void checkTimeDependent();
70 
71 
72  static void recordAttribute(const UT_StringHolder& name,
73  int thread);
74 
75  static bool isSuppressWarnings();
76  static bool setSuppressWarnings(bool suppress);
77 
78 private:
79  void reportWarning(
80  PDG_AttributeCast cast_result,
81  exint query_index,
82  const PDG_AttributeOwner* owner,
83  const PDG_Node* node,
84  bool is_string,
85  int thread) const;
86  void recordAttribute(
88  int thread) const;
89 
90  bool isInputFile() const;
91  bool isOutputFile() const;
92 
93 private:
94  UT_AttributeEvaluator *myWrapperEvaluator;
95  PDG_AttributeQuery myQuery;
96  UT_StringHolder myTag;
97  PDG_AttributeIntrinsic myAttributeType;
98  bool myIsLocalize;
99  bool myIsAllValues;
100 };
101 
102 #endif
PDG_AttributeIntrinsic
Enumeration of types of attribute that can be queried from work items.
#define PDG_API
Definition: PDG_API.h:23
int64 exint
Definition: SYS_Types.h:125
const UT_StringHolder & tag() const
**But if you need a result
Definition: thread.h:613
PDG_AttributeCast
Enumeration of attribute cast results.
GLuint const GLchar * name
Definition: glcorearb.h:786
virtual bool isStringValue() const
**Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun
fpreal64 fpreal
Definition: SYS_Types.h:277
const PDG_AttributeQuery & query() const
type
Definition: core.h:1059