nsSupportsWeakReference 编辑
Summary
Inherit from this C++ class to add canonical support for nsISupportsWeakReference
.
See Weak reference for detailed description of weak references.
#include "nsWeakReference.h"
class nsSupportsWeakReference { ... };
Remarks
In addition to inheriting from this class, you will need to ensure that your nsISupports::QueryInterface
implementation exposes nsISupportsWeakReference
as a supported interface.
To use this class, you must link your component or application against the XPCOM Glue library.
Example code
// Supporting weak references to a hypothetical implementation
// of the nsIFoo interface...
#include "nsWeakReference.h"
#include "nsIFoo.h"
class MyFoo : public nsIFoo, public nsSupportsWeakReference
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIFOO
...
};
NS_IMPL_ISUPPORTS2(MyFoo, nsIFoo, nsISupportsWeakReference)
...
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论