Lines Matching defs:IUnknown

52 typedef struct IUnknown IUnknown;

55 * @brief Defines the default IUnknown version. You can customize the version.
57 * The <b>IUnknown</b> interface of the default version can be called only in the current process.
66 * @brief Defines the macro for inheriting the <b>IUnknown</b> interface.
68 * When developing a subclass of the <b>IUnknown</b> class, you can use this macro to inherit the
69 * structures of the <b>IUnknown</b> interface. \n
73 int (*QueryInterface)(IUnknown *iUnknown, int version, void **target); \
74 int (*AddRef)(IUnknown *iUnknown); \
75 int (*Release)(IUnknown *iUnknown)
78 * @brief Defines the macro for inheriting the classes that implement the <b>IUnknown</b>
81 * When developing a subclass of a class that implements the <b>IUnknown</b> interface, you can use
82 * this macro to inherit the structures of the <b>IUnknown</b> implementation class. \n
91 * @brief Defines the default marco for initializing the <b>IUnknown</b> interface.
93 * When creating a subclass object of the <b>IUnknown</b> interface, you can use this macro to
94 * initialize members of the <b>IUnknown</b> interface to their default values. \n
103 * @brief Defines the macro for initializing the classes that implement the <b>IUnknown</b>
106 * When creating a subclass object of a class that implements the <b>IUnknown</b> interface, you
107 * can use this macro to initialize members of the <b>IUnknown</b> implementation class to their
119 * @brief IUnknown Defines the end macro for initializing the <b>IUnknown</b> implementation
122 * This macro is used when a subclass object of the <b>IUnknown</b> implementation class is
133 * @brief Obtains the pointer of the <b>IUnknown</b> interface object from the subclass object T
134 * (generic macro) of the <b>IUnknown</b> implementation class.
136 * Use this macro when registering <b>IUnknown</b> interfaces with Samgr so that you can obtain
137 * the interfaces from the subclass objects of different <b>IUnknown</b> implementation classes. \n
142 #define GET_IUNKNOWN(T) (IUnknown *)(&((T).iUnknown))
145 * @brief Defines the <b>IUnknown</b> class.
147 * You need to inherit this structure when developing a subclass of the <b>IUnknown</b> interface. \n
150 struct IUnknown {
152 * Queries the subclass object of the <b>IUnknown</b> interface of a specified version
155 int (*QueryInterface)(IUnknown *iUnknown, int version, void **target);
157 int (*AddRef)(IUnknown *iUnknown);
158 /** Release the reference to an <b>IUnknown</b> interface. */
159 int (*Release)(IUnknown *iUnknown);
163 * @brief Defines the <b>IUnknown</b> implementation class.
165 * You need to inherit this structure when developing a subclass of the <b>IUnknown</b>
168 * Each <b>IUnknown</b> interface must correspond to one or more <b>IUnknown</b> implementation
173 /** Version information of <b>IUnknown</b> interface. */
175 /** Reference count of <b>IUnknown</b> interface. */
178 * Implementation of <b>IUnknown</b> interface, which is related to the specific definition
181 IUnknown iUnknown;
185 * @brief Increments the reference count in this <b>IUnknown</b> interface.
188 * <b>IUnknown<b> interface. \n
196 * @param iUnknown Indicates the pointer to the <b>IUnknown<b> interface object.
197 * @return Indicates the number of objects that reference the <b>IUnknown<b> interface.
202 int IUNKNOWN_AddRef(IUnknown *iUnknown);
205 * @brief Queries the <b>IUnknown</b> interfaces of a specified version (downcasting).
207 * After obtaining the <b>IUnknown</b> interface object, the function caller uses
212 * @param iUnknown Indicates the pointer to the <b>IUnknown</b> interface.
213 * @param version Indicates the version of the <b>IUnknown</b> interface object to be converted.
214 * @param target Indicates the <b>IUnknown</b> subclass type required by the caller. This is an
222 int IUNKNOWN_QueryInterface(IUnknown *iUnknown, int ver, void **target);
225 * @brief Releases a reference to an <b>IUnknown</b> interface that is no longer used.
228 * the memory of the <b>IUnknown</b> interface object and implementation object is not released. \n
230 * If the memory of the <b>IUnknown</b> interface object and implementation object is dynamically
232 * If the reference count is <b>0</b>, the memory of the <b>IUnknown</b> interface object and
235 * @param iUnknown Indicates the pointer to the <b>IUnknown<b> interface object.
236 * @return Indicates the number of <b>IUnknown<b> interface objects that are referenced after the
242 int IUNKNOWN_Release(IUnknown *iUnknown);