InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
PreflightObjectID.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Matt Phillips
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 
34 
49 typedef uint32 PreflightDocumentID;
50 
118 {
119 public:
120  typedef object_type data_type;
121 
126  enum { kSmallInstanceDataSize = 16 };
127 
128 private:
129  char* fLargeInstanceDataPtr; // used for large instance data
130  char fSmallInstanceData[kSmallInstanceDataSize]; // used for small instance data
131 
132  PreflightObjectClassID fClassID;
133  PreflightDocumentID fDocID;
134 
135  uint32 fInstanceDataSize;
136 
137  uint32 fHash;
138 
139 public:
143 
155  (
156  PreflightObjectClassID classID,
157  PreflightDocumentID docID,
158  uint32 instanceDataSize = 0,
159  const char* instanceData = nil
160  );
161 
170  PreflightObjectID(char* serializedData, uint32 dataSize);
171 
177  PreflightObjectID(const PreflightObjectID& other);
178 
182 
183 public:
186  bool32 IsNil() const;
187 
188 public:
192  PreflightObjectClassID GetClassID() const { return fClassID; }
193 
199  void SetClassID(const PreflightObjectClassID& x) { fClassID = x; }
200 
207  PreflightDocumentID GetDocumentID() const { return fDocID; }
208 
216  void SetDocumentID(const PreflightDocumentID& x) { fDocID = x; }
217 
218 public:
219  uint32 GetHash() const { return fHash; }
220 
221 public:
227  uint32 GetInstanceDataSize() const;
228 
238  const void* GetInstanceData() const;
239 
245  bool32 SetInstanceData(uint32 dataSize, const void* pData);
246 
247 public:
257  bool32 SerializeFrom(uint32 sizeOfData, const void* serializedData);
258 
261  uint32 GetSerializedSize() const;
262 
271  bool32 SerializeTo(uint32 sizeOfData, char* serializedData) const;
272 
273 public:
279 
282  int operator==(const PreflightObjectID& other) const;
283 
286  int operator!=(const PreflightObjectID& other) const;
287 
290  int operator<(const PreflightObjectID& other) const;
291 
292 protected:
296  void RecalcHash();
297 
300  bool32 SetInstanceDataSize(uint32 dataSize, bool32 preserveData = kTrue);
301 };
302 
306 
310