VirtualBox

Ignore:
Timestamp:
Jun 5, 2008 1:43:54 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
31667
Message:

FE/Qt4: Some more minor Qt4 COM wrapper updates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/include/COMDefs.h

    r9401 r9425  
    3131 * @{
    3232 *
    33  * The Qt-COM support layer provides a set of defintions and smart classes for
     33 * The Qt-COM support layer provides a set of definitions and smart classes for
    3434 * writing simple, clean and platform-independent code to access COM/XPCOM
    3535 * components through exposed COM interfaces. This layer is based on the
    36  * COM/XPCOM Abstarction Layer library (the VBoxCOM glue library defined in
     36 * COM/XPCOM Abstraction Layer library (the VBoxCOM glue library defined in
    3737 * include/VBox/com and implemented in src/VBox/Main/glue).
    3838 *
     
    4242 * @{
    4343 *
    44  * COM/XPCOM arrays are mapped to QValueVector objects. QValueVector templates
    45  * declared with a type that corresponds to the COM type of elements in the
    46  * array using normal Qt-COM type mapping rules. Here is a code example that
    47  * demonstrates how to call interface methods that take and return arrays (this
    48  * example is based on examples given in @ref grp_COM_arrays):
     44 * COM/XPCOM arrays are mapped to QVector objects. QVector templates declared
     45 * with a type that corresponds to the COM type of elements in the array using
     46 * normal Qt-COM type mapping rules. Here is a code example that demonstrates
     47 * how to call interface methods that take and return arrays (this example is
     48 * based on examples given in @ref grp_COM_arrays):
    4949 * @code
    5050
     
    5353    // ...
    5454
    55     QValueVector <LONG> in (3);
     55    QVector <LONG> in (3);
    5656    in [0] = -1;
    5757    in [1] = -2;
    5858    in [2] = -3;
    5959
    60     QValueVector <LONG> out;
    61     QValueVector <LONG> ret;
     60    QVector <LONG> out;
     61    QVector <LONG> ret;
    6262
    6363    ret = component.TestArrays (in, out);
     
    258258    {
    259259        aArr.reset (aVec.size());
    260         size_t i = 0;
    261         for (typename QVector <T>::const_iterator it = aVec.begin();
    262              it != aVec.end(); ++ it, ++ i)
    263             aArr [i] = *it;
     260        for (int i = 0; i < aVec.size(); ++i)
     261            aArr [i] = aVec.at (i);
    264262    }
    265263
     
    267265    static void FromSafeArray (const com::SafeArray <T> &aArr, QVector <T> &aVec)
    268266    {
    269         aVec = QVector <T> (aArr.size());
    270         size_t i = 0;
    271         for (typename QVector <T>::iterator it = aVec.begin();
    272              it != aVec.end(); ++ it, ++ i)
    273             *it = aArr [i];
     267        aVec.resize (aArr.size());
     268        for (int i = 0; i < aVec.size(); ++i)
     269            aVec [i] = aArr [i];
    274270    }
    275271
     
    295291    {
    296292        aArr.reset (aVec.size());
    297         size_t i = 0;
    298         for (typename QVector <CI>::const_iterator it = aVec.begin();
    299              it != aVec.end(); ++ it, ++ i)
    300         {
    301             aArr [i] = (*it).iface();
     293        for (int i = 0; i < aVec.size(); ++i)
     294        {
     295            aArr [i] = aVec.at (i);
    302296            if (aArr [i])
    303297                aArr [i]->AddRef();
     
    309303                                    QVector <CI> &aVec)
    310304    {
    311         aVec = QVector <CI> (aArr.size());
    312         size_t i = 0;
    313         for (typename QVector <CI>::iterator it = aVec.begin();
    314              it != aVec.end(); ++ it, ++ i)
    315             (*it).attach (aArr [i]);
     305        aVec.resize (aArr.size());
     306        for (int i = 0; i < aVec.size(); ++i)
     307            aVec [i].attach (aArr [i]);
    316308    }
    317309
     
    525517
    526518    /**
    527      * Returns @c true if the result code repesents success (with or without
     519     * Returns @c true if the result code represents success (with or without
    528520     * warnings).
    529521     */
     
    531523
    532524    /**
    533      * Returns @c true if the result code represends success with one or more
     525     * Returns @c true if the result code represents success with one or more
    534526     * warnings.
    535527     */
     
    537529
    538530    /**
    539      * Returns @c true if the result code represends success with no warnings.
     531     * Returns @c true if the result code represents success with no warnings.
    540532     */
    541533    bool isReallyOk() const { return mRC == S_OK; }
     
    647639
    648640    /**
    649      * Returns @c true if the result code repesents success (with or without
     641     * Returns @c true if the result code represents success (with or without
    650642     * warnings).
    651643     */
     
    653645
    654646    /**
    655      * Returns @c true if the result code represends success with one or more
     647     * Returns @c true if the result code represents success with one or more
    656648     * warnings.
    657649     */
     
    659651
    660652    /**
    661      * Returns @c true if the result code represends success with no warnings.
     653     * Returns @c true if the result code represents success with no warnings.
    662654     */
    663655    bool isReallyOk() const { return !isNull() && B::mRC == S_OK; }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette