HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_AgentCustomDataItem.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 
7 #ifndef __GU_AgentCustomData__
8 #define __GU_AgentCustomData__
9 
10 #include "GU_API.h"
11 
12 #include <UT/UT_IntrusivePtr.h>
13 #include <UT/UT_StringHolder.h>
14 
15 class GU_AgentDefinition;
16 class UT_JSONParser;
17 class UT_JSONWriter;
18 
23 
24 /// A custom data item that can be added to a GU_AgentDefinition.
25 ///
26 /// Custom data item types are registered by calling
27 /// GU_AgentDefinition::registerCustomDataItemType() from the
28 /// GUregisterAgentCustomDataItemType() entry point.
30  : public UT_IntrusiveRefCounter<GU_AgentCustomDataItem>
31 {
32 public:
33  virtual ~GU_AgentCustomDataItem() = default;
34 
35  /// Unique identifier for the data item type, used when serializing to a
36  /// geometry file. This should correspond to the identifier passed to
37  /// GU_AgentDefinition::registerCustomDataItemType().
38  virtual const UT_StringHolder &dataItemType() const = 0;
39 
40  /// Name of the data item, used by GU_AgentDefinition when inserting or
41  /// search for an item. This varies per instance, unlike dataItemType().
42  virtual const UT_StringHolder &name() const = 0;
43 
44  /// The amount of memory used by this item.
45  virtual int64 getMemoryUsage(bool inclusive) const = 0;
46 
47  /// Load the data from JSON.
48  virtual bool load(UT_JSONParser &p) = 0;
49 
50  /// Save the data to JSON.
51  virtual bool save(UT_JSONWriter &w) const = 0;
52 };
53 
54 #endif
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:87
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:37
A reference counter base class for use with UT_IntrusivePtr.
Wrapper around hboost::intrusive_ptr.
long long int64
Definition: SYS_Types.h:116
#define GU_API
Definition: GU_API.h:14
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857