soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
obj-ref-i.h
1#ifndef __OBJ_REF_I__H__
2#define __OBJ_REF_I__H__
3
4#include <sdef.h>
5#include <objbase.h>
6#ifdef _WIN32
7#include <sguid.h>
8#else
9#include <guiddef.h>
10#endif // _WIN32
11
12#undef INTERFACE
13#define INTERFACE IObjRef
14/**
15 * @brief Interface for reference counting.
16 * @details This interface provides methods for increasing and decreasing the reference count of an object.
17 */
18DECLARE_INTERFACE(IObjRef)
19{
20 /**
21 * @brief Increases the reference count.
22 * @return The new reference count.
23 */
24 STDMETHOD_(long, AddRef)(THIS) PURE;
25
26 /**
27 * @brief Decreases the reference count.
28 * @return The new reference count.
29 */
30 STDMETHOD_(long, Release)(THIS) PURE;
31
32 /**
33 * @brief Called when the reference count reaches zero and the object is about to be released.
34 * @details This method is intended to perform any necessary cleanup before the object is deleted.
35 */
36 STDMETHOD_(void, OnFinalRelease)(THIS) PURE;
37};
38
39#endif // __OBJ_REF_I__H__
Interface for reference counting.
Definition obj-ref-i.h:19
long AddRef() PURE
Increases the reference count.
void OnFinalRelease() PURE
Called when the reference count reaches zero and the object is about to be released.
long Release() PURE
Decreases the reference count.