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_AttributeTypes.h"
15 
17 #include <UT/UT_StringHolder.h>
18 
19 class PDG_AttributeOwner;
21 class PDG_Node;
22 class PDG_WorkItem;
23 
24 /**
25  * Caches an attribute name and component, for use with @ expression in HScript
26  */
28 {
29 public:
30  PDG_AttributeEvaluator(const char* name);
32  const char* name,
33  int component);
36  int component);
37  ~PDG_AttributeEvaluator() override;
38 
39  // Note that these are not the proper overrides for the virtual
40  // evaluateF and evaluateS methods. Because PDG is built before CH,
41  // we have to be passed the current frame number by a wrapper
42  // UT_AttributeEvaluator subclass defined in OP.
43  bool evaluateAtFrameF(fpreal frame, int thread,
44  fpreal &result,
45  EvalDiagnostics &diagnostics) const;
46  bool evaluateAtFrameS(fpreal frame, int thread,
47  UT_StringHolder &result,
48  EvalDiagnostics &diagnostics) const;
49  bool isStringValue() const override;
50 
51  PDG_AttributeIntrinsic attributeType() const;
52  void setMetadata(const UT_StringHolder& tag,
53  bool localize,
54  bool all_values);
55 
56  bool isLocalize() const
57  { return myIsLocalize; }
58  bool isAllValues() const
59  { return myIsAllValues; }
60  const UT_StringHolder& tag() const
61  { return myTag; }
62  const UT_StringHolder& query() const
63  { return myQueryString; }
64 
65  void setWrapperEvaluator(UT_AttributeEvaluator *wrapper);
66  UT_AttributeEvaluator *wrapperEvaluator() const;
67  void checkTimeDependent();
68 
69 
70  static void recordAttribute(const UT_StringHolder& name,
71  int thread);
72 
73  static bool isSuppressWarnings();
74  static bool setSuppressWarnings(bool suppress);
75 
76 private:
77  void reportWarning(
78  PDG_AttributeCast cast_result,
79  const PDG_AttributeOwner* owner,
80  const PDG_Node* node,
81  bool is_string,
82  int thread) const;
83  void recordAttribute(
85  int thread) const;
86 
87  bool isInputFile() const;
88  bool isOutputFile() const;
89 
90 private:
91  UT_AttributeEvaluator *myWrapperEvaluator;
92  UT_StringHolder myQueryString;
93  UT_StringHolder myTag;
94  PDG_AttributeIntrinsic myAttributeType;
95  bool myIsLocalize;
96  bool myIsAllValues;
97 };
98 
99 #endif
PDG_AttributeIntrinsic
Enumeration of types of attribute that can be queried from work items.
#define PDG_API
Definition: PDG_API.h:23
const UT_StringHolder & tag() const
**But if you need a result
Definition: thread.h:613
PDG_AttributeCast
Enumeration of attribute cast results.
const UT_StringHolder & query() const
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
type
Definition: core.h:1059