VirtualBox

Changeset 10151 in vbox for trunk/include/VBox/com


Ignore:
Timestamp:
Jul 3, 2008 12:26:56 PM (16 years ago)
Author:
vboxsync
Message:

Main: SafeArray: Fixed: SafeArrayTraits::asInParam_Arr() was protected on XPCOM which prevented from using input safe arrays in methods.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/com/array.h

    r8155 r10151  
    214214struct SafeArrayTraits
    215215{
     216protected:
     217
    216218    static void Init (T &aElem) { aElem = 0; }
    217219    static void Uninit (T &aElem) { aElem = 0; }
    218220    static void Copy (const T &aFrom, T &aTo) { aTo = aFrom; }
     221
     222public:
    219223
    220224    /* Magic to workaround strict rules of par. 4.4.4 of the C++ standard (that
     
    236240struct SafeArrayTraits <PRUnichar *>
    237241{
     242protected:
     243
    238244    static void Init (PRUnichar * &aElem) { aElem = NULL; }
    239245    static void Uninit (PRUnichar * &aElem)
     
    252258    }
    253259
     260public:
     261
    254262    /* Magic to workaround strict rules of par. 4.4.4 of the C++ standard */
    255263    static const PRUnichar **__asInParam_Arr (PRUnichar **aArr)
     
    276284struct SafeArrayTraits <LONG>
    277285{
     286protected:
     287
    278288    static VARTYPE VarType() { return VT_I4; }
    279289    static void Copy (LONG aFrom, LONG &aTo) { aTo = aFrom; }
     
    283293struct SafeArrayTraits <ULONG>
    284294{
     295protected:
     296
    285297    static VARTYPE VarType() { return VT_UI4; }
    286298    static void Copy (ULONG aFrom, ULONG &aTo) { aTo = aFrom; }
     
    290302struct SafeArrayTraits <BSTR>
    291303{
     304protected:
     305
    292306    static VARTYPE VarType() { return VT_BSTR; }
    293307
     
    329343 */
    330344template  <typename T, class Traits = SafeArrayTraits <T> >
    331 class SafeArray : protected Traits
     345class SafeArray : public Traits
    332346{
    333347public:
     
    781795struct SafeIfaceArrayTraits
    782796{
     797protected:
     798
    783799    static void Init (I * &aElem) { aElem = NULL; }
    784800    static void Uninit (I * &aElem)
     
    802818    }
    803819
     820public:
     821
    804822    /* Magic to workaround strict rules of par. 4.4.4 of the C++ standard. */
    805823    static I **__asInParam_Arr (I **aArr) { return aArr; }
     
    812830struct SafeIfaceArrayTraits
    813831{
     832protected:
     833
    814834    static VARTYPE VarType() { return VT_UNKNOWN; }
    815835
Note: See TracChangeset for help on using the changeset viewer.

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