VirtualBox

Changeset 3348 in vbox for trunk/src/VBox/Main/include


Ignore:
Timestamp:
Jul 2, 2007 12:44:39 PM (18 years ago)
Author:
vboxsync
Message:

Main: Converted AudioAdapter and NetworkAdapter to the new locking scheme.

Location:
trunk/src/VBox/Main/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/AudioAdapterImpl.h

    r2981 r3348  
    2828
    2929class ATL_NO_VTABLE AudioAdapter :
     30    public VirtualBoxBaseNEXT,
    3031    public VirtualBoxSupportErrorInfoImpl <AudioAdapter, IAudioAdapter>,
    3132    public VirtualBoxSupportTranslation <AudioAdapter>,
    32     public VirtualBoxBase,
    3333    public IAudioAdapter
    3434{
     
    5353    };
    5454
     55    VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (AudioAdapter)
     56
    5557    DECLARE_NOT_AGGREGATABLE(AudioAdapter)
    5658
     
    6466    NS_DECL_ISUPPORTS
    6567
     68    DECLARE_EMPTY_CTOR_DTOR (AudioAdapter)
     69
    6670    HRESULT FinalConstruct();
    6771    void FinalRelease();
    6872
    6973    // public initializer/uninitializer for internal purposes only
    70     HRESULT init (Machine *parent);
    71     HRESULT init (Machine *parent, AudioAdapter *that);
    72     HRESULT initCopy (Machine *parent, AudioAdapter *that);
     74    HRESULT init (Machine *aParent);
     75    HRESULT init (Machine *aParent, AudioAdapter *aThat);
     76    HRESULT initCopy (Machine *aParent, AudioAdapter *aThat);
    7377    void uninit();
    7478
    75     STDMETHOD(COMGETTER(Enabled))(BOOL *enabled);
    76     STDMETHOD(COMSETTER(Enabled))(BOOL enabled);
    77     STDMETHOD(COMGETTER(AudioDriver)) (AudioDriverType_T *audioDriverType);
    78     STDMETHOD(COMSETTER(AudioDriver)) (AudioDriverType_T audioDriverType);
     79    STDMETHOD(COMGETTER(Enabled))(BOOL *aEnabled);
     80    STDMETHOD(COMSETTER(Enabled))(BOOL aEnabled);
     81    STDMETHOD(COMGETTER(AudioDriver)) (AudioDriverType_T *aAudioDriverType);
     82    STDMETHOD(COMSETTER(AudioDriver)) (AudioDriverType_T aAudioDriverType);
    7983
    8084    // public methods only for internal purposes
    8185
    82     const Backupable <Data> &data() const { return mData; }
    83 
    8486    bool isModified() { AutoLock alock (this); return mData.isBackedUp(); }
    8587    bool isReallyModified() { AutoLock alock (this); return mData.hasActualChanges(); }
    86     void rollback() { AutoLock alock (this); mData.rollback(); }
     88    bool rollback();
    8789    void commit();
    8890    void copyFrom (AudioAdapter *aThat);
     91
     92    // public methods for internal purposes only
     93    // (ensure there is a caller and a read lock before calling them!)
     94
     95    const Backupable <Data> &data() const { return mData; }
    8996
    9097    // for VirtualBoxSupportErrorInfoImpl
     
    93100private:
    94101
    95     ComObjPtr <Machine, ComWeakRef> mParent;
    96     ComObjPtr <AudioAdapter> mPeer;
     102    const ComObjPtr <Machine, ComWeakRef> mParent;
     103    const ComObjPtr <AudioAdapter> mPeer;
     104
    97105    Backupable <Data> mData;
    98106};
  • trunk/src/VBox/Main/include/NetworkAdapterImpl.h

    r2981 r3348  
    2929
    3030class ATL_NO_VTABLE NetworkAdapter :
    31     public VirtualBoxBase,
     31    public VirtualBoxBaseNEXT,
    3232    public VirtualBoxSupportErrorInfoImpl <NetworkAdapter, INetworkAdapter>,
    3333    public VirtualBoxSupportTranslation <NetworkAdapter>,
     
    8686    };
    8787
     88    VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (NetworkAdapter)
     89
    8890    DECLARE_NOT_AGGREGATABLE(NetworkAdapter)
    8991
     
    9799    NS_DECL_ISUPPORTS
    98100
     101    DECLARE_EMPTY_CTOR_DTOR (NetworkAdapter)
     102
    99103    HRESULT FinalConstruct();
    100104    void FinalRelease();
    101105
    102106    // public initializer/uninitializer for internal purposes only
    103     HRESULT init (Machine *parent, ULONG slot);
    104     HRESULT init (Machine *parent, NetworkAdapter *that);
    105     HRESULT initCopy (Machine *parent, NetworkAdapter *that);
     107    HRESULT init (Machine *aParent, ULONG aSlot);
     108    HRESULT init (Machine *aParent, NetworkAdapter *aThat);
     109    HRESULT initCopy (Machine *aParent, NetworkAdapter *aThat);
    106110    void uninit();
    107111
    108112    // INetworkAdapter properties
    109     STDMETHOD(COMGETTER(AdapterType))(NetworkAdapterType_T *adapterType);
    110     STDMETHOD(COMSETTER(AdapterType))(NetworkAdapterType_T adapterType);
    111     STDMETHOD(COMGETTER(Slot)) (ULONG *slot);
    112     STDMETHOD(COMGETTER(Enabled)) (BOOL *enabled);
    113     STDMETHOD(COMSETTER(Enabled)) (BOOL enabled);
    114     STDMETHOD(COMGETTER(MACAddress))(BSTR *macAddress);
    115     STDMETHOD(COMSETTER(MACAddress))(INPTR BSTR macAddress);
    116     STDMETHOD(COMGETTER(AttachmentType))(NetworkAttachmentType_T *attachmentType);
    117     STDMETHOD(COMGETTER(HostInterface))(BSTR *hostInterface);
    118     STDMETHOD(COMSETTER(HostInterface))(INPTR BSTR hostInterface);
     113    STDMETHOD(COMGETTER(AdapterType))(NetworkAdapterType_T *aAdapterType);
     114    STDMETHOD(COMSETTER(AdapterType))(NetworkAdapterType_T aAdapterType);
     115    STDMETHOD(COMGETTER(Slot)) (ULONG *aSlot);
     116    STDMETHOD(COMGETTER(Enabled)) (BOOL *aEnabled);
     117    STDMETHOD(COMSETTER(Enabled)) (BOOL aEnabled);
     118    STDMETHOD(COMGETTER(MACAddress)) (BSTR *aMACAddress);
     119    STDMETHOD(COMSETTER(MACAddress)) (INPTR BSTR aMACAddress);
     120    STDMETHOD(COMGETTER(AttachmentType)) (NetworkAttachmentType_T *aAttachmentType);
     121    STDMETHOD(COMGETTER(HostInterface)) (BSTR *aHostInterface);
     122    STDMETHOD(COMSETTER(HostInterface)) (INPTR BSTR aHostInterface);
    119123#ifdef VBOX_WITH_UNIXY_TAP_NETWORKING
    120     STDMETHOD(COMGETTER(TAPFileDescriptor))(LONG *tapFileDescriptor);
    121     STDMETHOD(COMSETTER(TAPFileDescriptor))(LONG tapFileDescriptor);
    122     STDMETHOD(COMGETTER(TAPSetupApplication))(BSTR *tapSetupApplication);
    123     STDMETHOD(COMSETTER(TAPSetupApplication))(INPTR BSTR tapSetupApplication);
    124     STDMETHOD(COMGETTER(TAPTerminateApplication))(BSTR *tapTerminateApplication);
    125     STDMETHOD(COMSETTER(TAPTerminateApplication))(INPTR BSTR tapTerminateApplication);
     124    STDMETHOD(COMGETTER(TAPFileDescriptor)) (LONG *aTAPFileDescriptor);
     125    STDMETHOD(COMSETTER(TAPFileDescriptor)) (LONG aTAPFileDescriptor);
     126    STDMETHOD(COMGETTER(TAPSetupApplication)) (BSTR *aTAPSetupApplication);
     127    STDMETHOD(COMSETTER(TAPSetupApplication)) (INPTR BSTR aTAPSetupApplication);
     128    STDMETHOD(COMGETTER(TAPTerminateApplication)) (BSTR *aTAPTerminateApplication);
     129    STDMETHOD(COMSETTER(TAPTerminateApplication)) (INPTR BSTR aTAPTerminateApplication);
    126130#endif
    127     STDMETHOD(COMGETTER(InternalNetwork))(BSTR *internalNetwork);
    128     STDMETHOD(COMSETTER(InternalNetwork))(INPTR BSTR internalNetwork);
    129     STDMETHOD(COMGETTER(CableConnected))(BOOL *connected);
    130     STDMETHOD(COMSETTER(CableConnected))(BOOL connected);
    131     STDMETHOD(COMGETTER(TraceEnabled))(BOOL *enabled);
    132     STDMETHOD(COMSETTER(TraceEnabled))(BOOL enabled);
    133     STDMETHOD(COMGETTER(TraceFile))(BSTR *traceFile);
    134     STDMETHOD(COMSETTER(TraceFile))(INPTR BSTR traceFile);
     131    STDMETHOD(COMGETTER(InternalNetwork)) (BSTR *aInternalNetwork);
     132    STDMETHOD(COMSETTER(InternalNetwork)) (INPTR BSTR aInternalNetwork);
     133    STDMETHOD(COMGETTER(CableConnected)) (BOOL *aConnected);
     134    STDMETHOD(COMSETTER(CableConnected)) (BOOL aConnected);
     135    STDMETHOD(COMGETTER(TraceEnabled)) (BOOL *aEnabled);
     136    STDMETHOD(COMSETTER(TraceEnabled)) (BOOL aEnabled);
     137    STDMETHOD(COMGETTER(TraceFile)) (BSTR *aTraceFile);
     138    STDMETHOD(COMSETTER(TraceFile)) (INPTR BSTR aTraceFile);
    135139
    136140    // INetworkAdapter methods
     
    142146    // public methods only for internal purposes
    143147
    144     const Backupable <Data> &data() const { return mData; }
    145 
    146148    bool isModified() { AutoLock alock (this); return mData.isBackedUp(); }
    147149    bool isReallyModified() { AutoLock alock (this); return mData.hasActualChanges(); }
     
    149151    void commit();
    150152    void copyFrom (NetworkAdapter *aThat);
     153
     154    // public methods for internal purposes only
     155    // (ensure there is a caller and a read lock before calling them!)
     156
     157    const Backupable <Data> &data() const { return mData; }
    151158
    152159    // for VirtualBoxSupportErrorInfoImpl
     
    158165    void generateMACAddress();
    159166
    160     ComObjPtr <Machine, ComWeakRef> mParent;
    161     ComObjPtr <NetworkAdapter> mPeer;
     167    const ComObjPtr <Machine, ComWeakRef> mParent;
     168    const ComObjPtr <NetworkAdapter> mPeer;
     169
    162170    Backupable <Data> mData;
    163171};
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