COMDefs.h revision dc09cb937d0a66e030b4d7bef88dec429f41e060
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * VBox frontends: Qt GUI ("VirtualBox"):
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * Various COM definitions and COM wrapper class declarations
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * This header is used in conjunction with the header generated from
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * XIDL expressed interface definitions to provide cross-platform Qt-based
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * interface wrapper classes.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * Copyright (C) 2006-2008 Oracle Corporation
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * available from http://www.virtualbox.org. This file is free software;
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * you can redistribute it and/or modify it under the terms of the GNU
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * General Public License (GPL) as published by the Free Software
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync/** @defgroup grp_QT_COM Qt-COM Support Layer
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * The Qt-COM support layer provides a set of definitions and smart classes for
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * writing simple, clean and platform-independent code to access COM/XPCOM
7e960d3a0a8a3a84d7aba2cca45d72b1c31cc97bvboxsync * components through exposed COM interfaces. This layer is based on the
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * COM/XPCOM Abstraction Layer library (the VBoxCOM glue library defined in
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * include/VBox/com and implemented in src/VBox/Main/glue).
61fa69e2bc9fc9e7490feed1c020273f3ddb238dvboxsync * @defgroup grp_QT_COM_arrays Arrays
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * COM/XPCOM arrays are mapped to QVector objects. QVector templates declared
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * with a type that corresponds to the COM type of elements in the array using
b74ca013e5f201a2dd371e6c438433ceac12af30vboxsync * normal Qt-COM type mapping rules. Here is a code example that demonstrates
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * how to call interface methods that take and return arrays (this example is
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * based on examples given in @ref grp_COM_arrays):
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync CSomething component;
223cf005b18af2c21352a70693ebaf0582f68ebcvboxsync QVector <LONG> in (3);
223cf005b18af2c21352a70693ebaf0582f68ebcvboxsync in [0] = -1;
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync in [1] = -2;
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync in [2] = -3;
afed5ab737f4aacfae3fe73776f40e989190a7cavboxsync QVector <LONG> out;
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync QVector <LONG> ret;
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync ret = component.TestArrays (in, out);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync for (size_t i = 0; i < ret.size(); ++ i)
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync LogFlow (("*** ret[%u]=%d\n", i, ret [i]));
7666082b743c5e146a8cee6cc794ff4bc3fd0ffdvboxsync/* Both VBox/com/assert.h and qglobal.h contain a definition of ASSERT.
7666082b743c5e146a8cee6cc794ff4bc3fd0ffdvboxsync * Either of them can be already included here, so try to shut them up. */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync/* Qt includes */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * Additional COM / XPCOM defines and includes
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync#else /* !defined (VBOX_WITH_XPCOM) */
22e281e75ed636601178296c6daebda8f1d17c59vboxsync#endif /* !defined (VBOX_WITH_XPCOM) */
22e281e75ed636601178296c6daebda8f1d17c59vboxsync/* VirtualBox interfaces declarations */
22e281e75ed636601178296c6daebda8f1d17c59vboxsync#else /* !defined (VBOX_WITH_XPCOM) */
22e281e75ed636601178296c6daebda8f1d17c59vboxsync#endif /* !defined (VBOX_WITH_XPCOM) */
22e281e75ed636601178296c6daebda8f1d17c59vboxsync/////////////////////////////////////////////////////////////////////////////
22e281e75ed636601178296c6daebda8f1d17c59vboxsync/** Represents extended error information */
22e281e75ed636601178296c6daebda8f1d17c59vboxsync , mIsBasicAvailable (false), mIsFullAvailable (false)
22e281e75ed636601178296c6daebda8f1d17c59vboxsync COMErrorInfo (const CVirtualBoxErrorInfo &info) { init (info); }
22e281e75ed636601178296c6daebda8f1d17c59vboxsync /* the default copy ctor and assignment op are ok */
22e281e75ed636601178296c6daebda8f1d17c59vboxsync bool isBasicAvailable() const { return mIsBasicAvailable; }
22e281e75ed636601178296c6daebda8f1d17c59vboxsync bool isFullAvailable() const { return mIsFullAvailable; }
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync const COMErrorInfo *next() const { return mNext.get(); }
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync QString interfaceName() const { return mInterfaceName; }
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync void fetchFromCurrentThread (IUnknown *callee, const GUID *calleeIID);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync static QString getInterfaceNameFromIID (const QUuid &id);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync/////////////////////////////////////////////////////////////////////////////
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * Base COM class the CInterface template and all wrapper classes are derived
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * from. Provides common functionality for all COM wrappers.
3ecf9412133496b2aeb090cfd33a286404ec59fbvboxsync * Returns the result code of the last interface method called by the
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * wrapper instance or the result of CInterface::createInstance()
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * operation.
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync /** Converts a GUID value to QUuid */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync id.Data4[0], id.Data4[1], id.Data4[2], id.Data4[3],
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync id.Data4[4], id.Data4[5], id.Data4[6], id.Data4[7]);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync#else /* !defined (VBOX_WITH_XPCOM) */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync /** Converts a GUID value to QUuid */
b74ca013e5f201a2dd371e6c438433ceac12af30vboxsync#endif /* !defined (VBOX_WITH_XPCOM) */
b74ca013e5f201a2dd371e6c438433ceac12af30vboxsync /* Arrays of arbitrary types */
b74ca013e5f201a2dd371e6c438433ceac12af30vboxsync static void ToSafeArray (const QVector <QT> &aVec, com::SafeArray <CT> &aArr)
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync static void FromSafeArray (const com::SafeArray <CT> &aArr, QVector <QT> &aVec)
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync static void ToSafeArray (const QVector <QT *> &aVec, com::SafeArray <CT *> &aArr)
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync static void FromSafeArray (const com::SafeArray <CT *> &aArr, QVector <QT *> &aVec)
22e281e75ed636601178296c6daebda8f1d17c59vboxsync /* Arrays of equal types */
3ecd8008b81f02a04220705ae0033142af363280vboxsync static void ToSafeArray (const QVector <T> &aVec, com::SafeArray <T> &aArr)
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync static void FromSafeArray (const com::SafeArray <T> &aArr, QVector <T> &aVec)
3ecd8008b81f02a04220705ae0033142af363280vboxsync /* Arrays of strings */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync static void ToSafeArray (const QVector <QString> &aVec,
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync static void FromSafeArray (const com::SafeArray <BSTR> &aArr,
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync /* Arrays of GUID */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync static void ToSafeArray (const QVector <QUuid> &aVec,
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync static void FromSafeArray (const com::SafeGUIDArray &aArr,
22e281e75ed636601178296c6daebda8f1d17c59vboxsync /* Arrays of enums. Does a cast similar to what ENUMOut does. */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync static void FromSafeArray (const com::SafeIfaceArray <CE> &aArr,
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync /* Arrays of interface pointers. Note: we need a separate pair of names
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * only because the MSVC8 template matching algorithm is poor and tries to
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * instantiate a com::SafeIfaceArray <BSTR> (!!!) template otherwise for
b74ca013e5f201a2dd371e6c438433ceac12af30vboxsync * *no* reason and fails. Note that it's also not possible to choose the
22e281e75ed636601178296c6daebda8f1d17c59vboxsync * correct function by specifying template arguments explicitly because then
b74ca013e5f201a2dd371e6c438433ceac12af30vboxsync * it starts to try to instantiate the com::SafeArray <I> template for
b74ca013e5f201a2dd371e6c438433ceac12af30vboxsync * *no* reason again and fails too. Definitely, broken. Works in GCC like a
b74ca013e5f201a2dd371e6c438433ceac12af30vboxsync * charm. */
b74ca013e5f201a2dd371e6c438433ceac12af30vboxsync static void ToSafeIfaceArray (const QVector <CI> &aVec,
533ffcb943c4af2c5fe6385d816d0ba3eda9383bvboxsync static void FromSafeIfaceArray (const com::SafeIfaceArray <I> &aArr,
13ba5527caaa9b8c4fee29f22e374fa67c4c6f72vboxsync /* no arbitrary instance creations */
1843553dbdf4e46417158b4c6348c503adf10740vboxsync /** Adapter to pass QString as input BSTR params */
1843553dbdf4e46417158b4c6348c503adf10740vboxsync BSTRIn (const QString &s) : bstr (SysAllocString ((const OLECHAR *)
13ba5527caaa9b8c4fee29f22e374fa67c4c6f72vboxsync /** Adapter to pass QString as output BSTR params */
533ffcb943c4af2c5fe6385d816d0ba3eda9383bvboxsync * Adapter to pass K* enums as output COM enum params (*_T).
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * @param QE K* enum.
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync * @param CE COM enum.
3cbb4f9a6a320e58ed398ef7aaa004cc8727abc5vboxsync /** Adapter to pass QUuid as input GUID params */
0e77737b0ba913683e614db11463b31ca67aacbevboxsync static GUID GUIDIn (const QUuid &uuid) { return uuid; }
0e77737b0ba913683e614db11463b31ca67aacbevboxsync /** Adapter to pass QUuid as output GUID params */
b74ca013e5f201a2dd371e6c438433ceac12af30vboxsync guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3],
2d53f6e472561965d363674e17f48d3bdffc24d3vboxsync guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync#else /* !defined (VBOX_WITH_XPCOM) */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync /** Adapter to pass QUuid as input GUID params */
22e281e75ed636601178296c6daebda8f1d17c59vboxsync /** Adapter to pass QUuid as output GUID params */
806d0b554daa555364af5f87bc96eccbe760db7avboxsync nsid->m3[0], nsid->m3[1], nsid->m3[2], nsid->m3[3],
22e281e75ed636601178296c6daebda8f1d17c59vboxsync nsid->m3[4], nsid->m3[5], nsid->m3[6], nsid->m3[7]);
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync#endif /* !defined (VBOX_WITH_XPCOM) */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync static void addref (IUnknown *aIface) { if (aIface) aIface->AddRef(); }
13ba5527caaa9b8c4fee29f22e374fa67c4c6f72vboxsync static void release (IUnknown *aIface) { if (aIface) aIface->Release(); }
13ba5527caaa9b8c4fee29f22e374fa67c4c6f72vboxsync/////////////////////////////////////////////////////////////////////////////
13ba5527caaa9b8c4fee29f22e374fa67c4c6f72vboxsync * Alternative base class for the CInterface template that adds the errorInfo()
806d0b554daa555364af5f87bc96eccbe760db7avboxsync * method for providing extended error info about unsuccessful invocation of the
806d0b554daa555364af5f87bc96eccbe760db7avboxsync * last called interface method.
6ae4b1c72625a8e5c369effea7f018b578d733c4vboxsync * Returns error info set by the last unsuccessfully invoked interface
806d0b554daa555364af5f87bc96eccbe760db7avboxsync * method. Returned error info is useful only if CInterface::lastRC()
806d0b554daa555364af5f87bc96eccbe760db7avboxsync * represents a failure or a warning (i.e. CInterface::isReallyOk() is
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync const COMErrorInfo &errorInfo() const { return mErrInfo; }
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync /* no arbitrary instance creation */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync void setErrorInfo (const COMErrorInfo &aErrInfo) { mErrInfo = aErrInfo; }
6ae4b1c72625a8e5c369effea7f018b578d733c4vboxsync void fetchErrorInfo (IUnknown *aCallee, const GUID *aCalleeIID) const
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync mErrInfo.fetchFromCurrentThread (aCallee, aCalleeIID);
22e281e75ed636601178296c6daebda8f1d17c59vboxsync/////////////////////////////////////////////////////////////////////////////
79b24ef0ab7cd4a03a3571b3954c52ab8b573137vboxsync * Simple class that encapsulates the result code and COMErrorInfo.
3cac8f8c6923a3a89ecfccda5e89ad75f48658e0vboxsync * Queries the current result code from the given component.
5e797edc29f96c8367de4fbf5874171c24a89ba7vboxsync * Queries the current result code and error info from the given component.
8e8844a522f5d335f177a0313b03067d79cce201vboxsync * Queries the current result code from the given component.
e08de24d4792d31b7f2aac29db5cb8840d940009vboxsync * Queries the current result code and error info from the given component.
e08de24d4792d31b7f2aac29db5cb8840d940009vboxsync COMResult &operator= (const COMBaseWithEI &aComponent)
79b24ef0ab7cd4a03a3571b3954c52ab8b573137vboxsync * Returns @c true if the result code represents success (with or without
e149c362e69e5f0bbd82da11fd8163b2d29c3a72vboxsync * warnings).
13ba5527caaa9b8c4fee29f22e374fa67c4c6f72vboxsync * Returns @c true if the result code represents success with one or more
13ba5527caaa9b8c4fee29f22e374fa67c4c6f72vboxsync * warnings.
3dde2f85d4cf477621a3128887a2c08a8bca7c01vboxsync bool isWarning() const { return SUCCEEDED_WARNING (mRC); }
7bae75e0b207aa4d4cad2a951271ad1a0e8ab9fdvboxsync * Returns @c true if the result code represents success with no warnings.
79b24ef0ab7cd4a03a3571b3954c52ab8b573137vboxsync COMErrorInfo errorInfo() const { return mErrInfo; }
7082d29724f6c3788977a51591b0379fd3acbf72vboxsync/////////////////////////////////////////////////////////////////////////////
6f0193f5a9287559d34a75f438c2682d8fb08038vboxsync * Wrapper template class for all interfaces.
22e281e75ed636601178296c6daebda8f1d17c59vboxsync * All interface methods named as they are in the original, i.e. starting
6f0193f5a9287559d34a75f438c2682d8fb08038vboxsync * with the capital letter. All utility non-interface methods are named
e4ea543752422f1139923e3e506c625b0a1827c5vboxsync * starting with the small letter. Utility methods should be not normally
f9147fe1eaa4e35287f8f39282c7f92f0d7de0b7vboxsync * called by the end-user client application.
f827fea1108b8f8a1a5f63318f6ec3cf4a9e7010vboxsync * @param I Interface class (i.e. IUnknown/nsISupports derivant).
f9147fe1eaa4e35287f8f39282c7f92f0d7de0b7vboxsync * @param B Base class, either COMBase (by default) or COMBaseWithEI.
13ba5527caaa9b8c4fee29f22e374fa67c4c6f72vboxsync // constructors & destructor
22e281e75ed636601178296c6daebda8f1d17c59vboxsync CInterface (const CInterface &that) : B (that), mIface (that.mIface)
6f0193f5a9287559d34a75f438c2682d8fb08038vboxsync CInterface (I *aIface) : mIface (aIface) { addref (mIface); }
6f0193f5a9287559d34a75f438c2682d8fb08038vboxsync // utility methods
f9147fe1eaa4e35287f8f39282c7f92f0d7de0b7vboxsync AssertMsg (!mIface, ("Instance is already non-NULL\n"));
6f0193f5a9287559d34a75f438c2682d8fb08038vboxsync B::mRC = CoCreateInstance (aClsId, NULL, CLSCTX_ALL,
e0b9d3c357adf9b7d05f55540e86f22943fc4b23vboxsync#else /* !defined (VBOX_WITH_XPCOM) */
6f0193f5a9287559d34a75f438c2682d8fb08038vboxsync B::mRC = NS_GetComponentManager (getter_AddRefs (manager));
13ba5527caaa9b8c4fee29f22e374fa67c4c6f72vboxsync B::mRC = manager->CreateInstance (aClsId, nsnull, NS_GET_IID (I),
6f0193f5a9287559d34a75f438c2682d8fb08038vboxsync (void **) &mIface);
6f0193f5a9287559d34a75f438c2682d8fb08038vboxsync#endif /* !defined (VBOX_WITH_XPCOM) */
6f0193f5a9287559d34a75f438c2682d8fb08038vboxsync /* fetch error info, but don't assert if it's missing -- many other
22e281e75ed636601178296c6daebda8f1d17c59vboxsync * reasons can lead to an error (w/o providing error info), not only
6f0193f5a9287559d34a75f438c2682d8fb08038vboxsync * the instance initialization code (that should always provide it) */
f9147fe1eaa4e35287f8f39282c7f92f0d7de0b7vboxsync * Attaches to the given foreign interface pointer by querying the own
f9147fe1eaa4e35287f8f39282c7f92f0d7de0b7vboxsync * interface on it. The operation may fail.
65b61798a61dd4c32cce448db1dac70bba8d5cf5vboxsync /* be aware of self assignment */
13ba5527caaa9b8c4fee29f22e374fa67c4c6f72vboxsync B::mRC = aIface->QueryInterface (_ATL_IIDOF (I), (void **) &mIface);
22e281e75ed636601178296c6daebda8f1d17c59vboxsync#else /* !defined (VBOX_WITH_XPCOM) */
13ba5527caaa9b8c4fee29f22e374fa67c4c6f72vboxsync B::mRC = aIface->QueryInterface (NS_GET_IID (I), (void **) &mIface);
13ba5527caaa9b8c4fee29f22e374fa67c4c6f72vboxsync#endif /* !defined (VBOX_WITH_XPCOM) */
e08de24d4792d31b7f2aac29db5cb8840d940009vboxsync /** Specialization of attach() for our own interface I. Never fails. */
13ba5527caaa9b8c4fee29f22e374fa67c4c6f72vboxsync /* be aware of self assignment */
65b61798a61dd4c32cce448db1dac70bba8d5cf5vboxsync /** Detaches from the underlying interface pointer. */
65b61798a61dd4c32cce448db1dac70bba8d5cf5vboxsync /** Returns @c true if not attached to any interface pointer. */
46df4404c8dbbf3672e7aae8cd0b2770356e5b73vboxsync * Returns @c true if the result code represents success (with or without
46df4404c8dbbf3672e7aae8cd0b2770356e5b73vboxsync * warnings).
3cac8f8c6923a3a89ecfccda5e89ad75f48658e0vboxsync bool isOk() const { return !isNull() && SUCCEEDED (B::mRC); }
e0b9d3c357adf9b7d05f55540e86f22943fc4b23vboxsync * Returns @c true if the result code represents success with one or more
46df4404c8dbbf3672e7aae8cd0b2770356e5b73vboxsync * warnings.
3dde2f85d4cf477621a3128887a2c08a8bca7c01vboxsync bool isWarning() const { return !isNull() && SUCCEEDED_WARNING (B::mRC); }
3dde2f85d4cf477621a3128887a2c08a8bca7c01vboxsync * Returns @c true if the result code represents success with no warnings.
6ae4b1c72625a8e5c369effea7f018b578d733c4vboxsync bool isReallyOk() const { return !isNull() && B::mRC == S_OK; }
3dde2f85d4cf477621a3128887a2c08a8bca7c01vboxsync // utility operators
46df4404c8dbbf3672e7aae8cd0b2770356e5b73vboxsync * Returns the raw interface pointer. Not intended to be used for anything
5db1d52ffbcaa46c3d944c6c2d9c552306817d9avboxsync * else but in generated wrappers and for debugging. You've been warned.
585f64d6f624f9e683321dabeb21b0eb2e6aa473vboxsync bool operator== (const CInterface &that) const { return mIface == that.mIface; }
585f64d6f624f9e683321dabeb21b0eb2e6aa473vboxsync bool operator!= (const CInterface &that) const { return mIface != that.mIface; }
22e281e75ed636601178296c6daebda8f1d17c59vboxsync * @todo: rethink if we'll ever need 'protected' back, removed to allow mIface access in rather
585f64d6f624f9e683321dabeb21b0eb2e6aa473vboxsync * nontrivial inheritance situations, see 'friend wrappers' code in COMWrappers.xsl
585f64d6f624f9e683321dabeb21b0eb2e6aa473vboxsync//protected:
585f64d6f624f9e683321dabeb21b0eb2e6aa473vboxsync/////////////////////////////////////////////////////////////////////////////
585f64d6f624f9e683321dabeb21b0eb2e6aa473vboxsyncclass CUnknown : public CInterface <IUnknown, COMBaseWithEI>
6ae4b1c72625a8e5c369effea7f018b578d733c4vboxsync /** Creates an instance given another CInterface-based instance. */
585f64d6f624f9e683321dabeb21b0eb2e6aa473vboxsync explicit CUnknown (const CInterface <OI, OB> &that)
585f64d6f624f9e683321dabeb21b0eb2e6aa473vboxsync /* preserve old error info if any */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync /** Constructor specialization for IUnknown. */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync /** Creates an instance given a foreign interface pointer. */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync /** Constructor specialization for IUnknown. */
fdc5224bd8d9a60af82da5809e3d6729c9bc69cbvboxsync explicit CUnknown (IUnknown *aIface) : Base (aIface) {}
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync /** Assigns from another CInterface-based instance. */
3cbb4f9a6a320e58ed398ef7aaa004cc8727abc5vboxsync CUnknown &operator= (const CInterface <OI, OB> &that)
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync /* preserve old error info if any */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync /** Assignment specialization for CUnknown. */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync /** Assigns from a foreign interface pointer. */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync /** Assignment specialization for IUnknown. */
e9a217d585085a6a6d129d27ca0d96a1b8e6d0eevboxsync /* @internal Used in generated wrappers. Never use directly. */
e17bd6c32a8dd64f2d42838f9028216465e2caf0vboxsync/////////////////////////////////////////////////////////////////////////////
e9a217d585085a6a6d129d27ca0d96a1b8e6d0eevboxsync/* include the generated header containing concrete wrapper definitions */
d408b82da0773c7e8cd4b3a01cb8a065a2c73a2dvboxsync#endif // __COMDefs_h__