HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SHOP_Data.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  * NAME: SHOP_Data.h ( SHOP Library, C++)
7  *
8  * COMMENTS: This class is used for passing data between the SHOP library
9  * and the IFD library. Because the data passed to renderers can
10  * be arbitrary, we need a nice clean mechanism which doesn't
11  * encourage memory leaks.
12  *
13  * This class is meant to be sub-classed.
14  */
15 
16 #ifndef __SHOP_Data__
17 #define __SHOP_Data__
18 
19 #include "SHOP_API.h"
20 class SHOP_Clerk;
21 
23 {
24 public:
25  SHOP_Data(const SHOP_Clerk *clerk);
26  virtual ~SHOP_Data();
27 
28  virtual const void *getRenderData() = 0;
29  virtual const char *getStringData() = 0;
30 
31  int matchKey(const SHOP_Clerk *clerk,
32  int caller_obj, int caller_sop)
33  {
34  return clerk == myClerk;
35  }
36  const SHOP_Clerk *getClerk() const { return myClerk; }
37 protected:
39 
40 private:
41 };
42 
44 {
45 public:
46  SHOP_StringData(const SHOP_Clerk *clerk);
47  ~SHOP_StringData() override;
48 
49  const void *getRenderData() override { return (const void *)myData; }
50  const char *getStringData() override { return myData; }
51 
52  void setString(const char *str);
53  void adoptString(char *str);
54 
55 protected:
56  char *myData;
57 };
58 
59 #endif
const SHOP_Clerk * getClerk() const
Definition: SHOP_Data.h:36
#define SHOP_API
Definition: SHOP_API.h:10
int matchKey(const SHOP_Clerk *clerk, int caller_obj, int caller_sop)
Definition: SHOP_Data.h:31
const void * getRenderData() override
Definition: SHOP_Data.h:49
const char * getStringData() override
Definition: SHOP_Data.h:50
const SHOP_Clerk * myClerk
Definition: SHOP_Data.h:38
char * myData
Definition: SHOP_Data.h:56