InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IControllingUnknown.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: robin briggs
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 // Review Date:
24 //
25 //========================================================================================
26 
27 #include "IPMUnknown.h"
28 #include "ShuksanID.h"
29 #include "InterfaceTrackingUtils.h"
30 #include <vector>
31 #include "IDThreading.h"
32 #ifndef __IControllingUnknown__
33 #define __IControllingUnknown__
34 
35 class LogObject;
36 
46 {
47 public:
48  enum { kDefaultIID = IID_ICONTROLLINGUNKNOWN };
49 
55  virtual ClassID GetClass() const = 0;
56 
62  virtual ImplementationID GetImplementationID(IPMUnknown *p) const = 0;
63 
69  virtual PMIID GetInterfaceID(IPMUnknown *p) const = 0;
70 
74  virtual uint32 GetRefCount() const = 0;
75 
82  virtual IPMUnknown* GetInterfacePtr(PMIID interfaceID) const = 0;
83 
89  virtual IPMUnknown* GetInterfacePtr(ImplementationID implID) const = 0;
90 
96  virtual const IPMPersist* GetPersist() const = 0;
97 
98 #ifdef DEBUG
99 
106  virtual IPMUnknown* GetInterfacePtrByIndex(int32 index) const = 0;
107  // If onOrOff is true, overwrites the vtbl pointer of every interface
108  // with AssertVtbl (asserts & exittoshell). It onOrOff is false, the
109  // AssertVtbl is cleared, and the original vtbl is restored. This is
110  // used for debugging objects in the instance cache, which are candidates
111  // for destruction (and shouldn't be used). Returns the old value of the
112  // setting. This is only to be called by the instance cache of the database.
113  virtual bool16 SetAssertOnCall(bool16 onOrOff) = 0;
114  // temporarily override the assert
115  // must be used balanced with EnableAssertOnCall()
116  virtual void DisableAssertOnCall() = 0;
117  virtual void EnableAssertOnCall() = 0;
118 
119  virtual void SetDebugUID (UID id) = 0;
120 
121  virtual void SetChecksum(IPMUnknown *face, uint32 newChecksum) = 0;
122  virtual void SetChecksum(int32 faceIndex, uint32 newChecksum) = 0;
123  virtual uint32 GetChecksum(int32 faceIndex)const = 0;
124 
125  // Debug methods to help track boss leaks.
126  virtual void DebugAddRef(IPMUnknown* whichInterface) const = 0;
127  virtual void DebugRelease(IPMUnknown* whichInterface) const = 0;
128 #ifdef INTERFACEPROXIES_SUPPORTED
129  virtual void SetOwningBoss (const IControllingUnknown *boss) = 0;
130  virtual const IControllingUnknown * GetOwningBoss () const = 0;
131  virtual const IControllingUnknown * GetDelegateBoss () const = 0;
132  virtual void RemoveFromProxyList(const int32 ProxyID) = 0;
133  virtual void ReportOverReleasedProxyError(const int32 ProxyID) const = 0;
134  virtual void InsertAddRefStackCrawl(const int32 ProxyID) = 0;
135  virtual void InsertReleaseStackCrawl(const int32 ProxyID) = 0;
136  virtual void DumpInterfacesToTrack (LogObject * logObject, std::vector<std::pair<ClassID, PMIID> >&leaksSoFarReported) const = 0;
137 #endif
138  virtual void DumpBossInterfaceReferences(LogObject * logObject) const = 0;
139 
140 #endif
141  virtual void SwitchExecutionContext() = 0;
142 };
143 
144 
145 #endif // __IControllingUnknown__