HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_WorkItemData.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_WORK_ITEM_DATA_H__
10 #define __PDG_WORK_ITEM_DATA_H__
11 
12 #include "PDG_API.h"
13 
14 #include "PDG_AttributeMap.h"
15 #include "PDG_RegisteredType.h"
16 #include "PDG_WorkItemTypes.h"
17 
18 #include <UT/UT_StringHolder.h>
19 
20 class UT_JSONValue;
21 class UT_JSONWriter;
22 
23 class PDG_Scheduler;
24 class PDG_TypeRegistry;
25 class PDG_WorkItem;
26 
28 {
29 public:
30  static void registerTypes(PDG_TypeRegistry* registry);
31 
33  PDG_WorkItemData(const PDG_BaseType* base_type,
34  const PDGT_ValueArgs& extra_args);
35  ~PDG_WorkItemData() override;
36 
37  int64 getMemoryUsage(bool inclusive) const override;
38 
39  virtual UT_StringHolder serialize(const PDG_WorkItem*,
40  const PDG_Scheduler*) const;
41  virtual bool deserialize(const UT_StringHolder& str);
42  virtual bool serializeToFile(const UT_StringHolder&,
43  const PDG_WorkItem*,
44  const PDG_Scheduler*) const
45  {
46  return false;
47  }
48  bool load(const UT_JSONValue& json_val);
49 
50  virtual void clone(const PDG_WorkItemData* data);
51  virtual bool compare(PDG_WorkItemData* item) const
52  {
53  return this == item;
54  }
55 
56  void setWorkItem(PDG_WorkItem* work_item);
57  PDG_WorkItem* workItem();
58 
59  virtual bool setFloat(const UT_StringHolder& name,
60  fpreal data,
61  int index);
62  bool setFloatArray(const UT_StringHolder& name,
64 
65  virtual bool setInt(const UT_StringHolder& name,
66  int data,
67  int index);
68  bool setIntArray(const UT_StringHolder& name,
70 
71  virtual bool setString(const UT_StringHolder& name,
72  const UT_StringHolder& data,
73  int index);
74  bool setStringArray(const UT_StringHolder& name,
76 
77  virtual bool floatData(fpreal& param,
78  const UT_StringHolder& name,
79  int index) const;
80  virtual bool floatData(PDG_AttributeFloat::Map& params) const;
81  bool floatData(PDG_AttributeFloat::Array& param,
82  const UT_StringHolder& name) const;
83 
84  virtual bool intData(exint& param,
85  const UT_StringHolder& name,
86  int index) const;
87  virtual bool intData(PDG_AttributeInteger::Map& params) const;
88  bool intData(PDG_AttributeInteger::Array& param,
89  const UT_StringHolder& name) const;
90 
91  virtual bool stringData(UT_StringHolder& param,
92  const UT_StringHolder& name,
93  int index) const;
94  virtual bool stringData(PDG_AttributeString::Map& params) const;
95  bool stringData(PDG_AttributeString::Array& param,
96  const UT_StringHolder& name) const;
97 
98  virtual bool clearFloatData();
99  virtual bool clearIntData();
100  virtual bool clearStringData();
101  virtual bool removeData(const UT_StringHolder& name, int index);
102 
103  virtual bool cook()
104  {
105  return false;
106  }
107 
108 private:
109  bool save(UT_JSONWriter& writer) const;
110 
111 private:
112  PDG_WorkItem* myWorkItem;
113 };
114 
115 #endif /* __PDG_WORK_ITEM_DATA_H__ */
virtual bool cook()
#define PDG_API
Definition: PDG_API.h:23
int64 exint
Definition: SYS_Types.h:125
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:37
virtual bool serializeToFile(const UT_StringHolder &, const PDG_WorkItem *, const PDG_Scheduler *) const
GLenum const GLfloat * params
Definition: glcorearb.h:105
virtual int64 getMemoryUsage(bool inclusive) const
long long int64
Definition: SYS_Types.h:116
GLuint const GLchar * name
Definition: glcorearb.h:786
GLenum GLfloat param
Definition: glcorearb.h:104
virtual bool compare(PDG_WorkItemData *item) const
fpreal64 fpreal
Definition: SYS_Types.h:277
GLuint index
Definition: glcorearb.h:786
Class to store JSON objects as C++ objects.
Definition: UT_JSONValue.h:99
Definition: format.h:895