InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
InterfaceTrackingUtils.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Habib Khalfallah
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 #ifndef __InterfaceTrackingUtils__
25 #define __InterfaceTrackingUtils__
26 #ifdef DEBUG
27 #ifdef __OMTypes__
28 #ifdef __clang__ // Not supported until we convert the assembly code
29  //#define INTERFACEPROXIES_SUPPORTED
30  //#undef TRACKING_ALL
31 #else
32 #define INTERFACEPROXIES_SUPPORTED
33  #undef TRACKING_ALL
34 #endif
35 #endif
36 #endif
37 
38 #ifdef DEBUG
39 #ifdef __OMTypes__
40 
41 class IPMUnknown;
42 namespace InterfaceTrackingUtils
43 {
44  void ReportOutStandingBosses();
45  void ReportOutstandingBoss(IPMUnknown *bossIFace, char *logfile);
46  void ReportOutstandingBoss(ClassID cls, char *logfile);
47 
48  const IPMUnknown * ExtractInterfaceImplementation (const IPMUnknown *pIFace);
49 
50  inline const void * ExtractInterfaceImplementation (const void *pIFace)
51  {return pIFace;}
52 
53  inline bool16 EqualIFacePtrs (const IPMUnknown *p1, const IPMUnknown *p2)
54  {
55  const IPMUnknown *_p1 = ExtractInterfaceImplementation(p1);
56  const IPMUnknown *_p2 = ExtractInterfaceImplementation(p2);
57 
58  return (_p1 == _p2);
59  }
60 
61 #ifdef INTERFACEPROXIES_SUPPORTED
62  // singleton that is intialized and destroyed at load of omlib.
63  // no thread contention involved
64  extern void * ts_SharedProxyObj;
65 #endif
66 }
67 
68 #endif //__OMTypes__
69 #endif // DEBUG
70 #endif // __InterfaceTrackingUtils__