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 
16 #include <UT/UT_StringHolder.h>
17 
18 class UT_JSONValue;
19 class UT_JSONWriter;
20 
21 class PDG_Scheduler;
22 class PDG_TypeRegistry;
23 class PDG_WorkItem;
24 
26 {
27 public:
28  static void registerTypes(PDG_TypeRegistry* registry);
29 
31  PDG_WorkItemData(const PDG_BaseType* base_type,
32  const PDGT_ValueArgs& extra_args);
33  ~PDG_WorkItemData() override;
34 
35  int64 getMemoryUsage(bool inclusive) const override;
36 
37  virtual UT_StringHolder serialize(const PDG_WorkItem*,
38  const PDG_Scheduler*) const;
39  virtual bool deserialize(const UT_StringHolder& str);
40  virtual bool serializeToFile(const UT_StringHolder&,
41  const PDG_WorkItem*,
42  const PDG_Scheduler*) const
43  {
44  return false;
45  }
46  bool load(const UT_JSONValue& json_val);
47 
48  virtual void clone(const PDG_WorkItemData* data);
49  virtual bool compare(PDG_WorkItemData* item) const
50  {
51  return this == item;
52  }
53 
54  void setWorkItem(PDG_WorkItem* work_item);
55  PDG_WorkItem* workItem();
56 
57  virtual bool setFloat(const UT_StringHolder& name,
58  fpreal data,
59  int index);
60  bool setFloatArray(const UT_StringHolder& name,
62 
63  virtual bool setInt(const UT_StringHolder& name,
64  int data,
65  int index);
66  bool setIntArray(const UT_StringHolder& name,
68 
69  virtual bool setString(const UT_StringHolder& name,
70  const UT_StringHolder& data,
71  int index);
72  bool setStringArray(const UT_StringHolder& name,
74 
75  virtual bool floatData(fpreal& param,
76  const UT_StringHolder& name,
77  int index) const;
78  virtual bool floatData(PDG_AttributeFloat::Map& params) const;
79  bool floatData(PDG_AttributeFloat::Array& param,
80  const UT_StringHolder& name) const;
81 
82  virtual bool intData(exint& param,
83  const UT_StringHolder& name,
84  int index) const;
85  virtual bool intData(PDG_AttributeInteger::Map& params) const;
86  bool intData(PDG_AttributeInteger::Array& param,
87  const UT_StringHolder& name) const;
88 
89  virtual bool stringData(UT_StringHolder& param,
90  const UT_StringHolder& name,
91  int index) const;
92  virtual bool stringData(PDG_AttributeString::Map& params) const;
93  bool stringData(PDG_AttributeString::Array& param,
94  const UT_StringHolder& name) const;
95 
96  virtual bool clearFloatData();
97  virtual bool clearIntData();
98  virtual bool clearStringData();
99  virtual bool removeData(const UT_StringHolder& name, int index);
100 
101  virtual bool cook()
102  {
103  return false;
104  }
105 
106 private:
107  bool save(UT_JSONWriter& writer) const;
108 
109 private:
110  PDG_WorkItem* myWorkItem;
111 };
112 
113 #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