VirtualBox

Changeset 50922 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 28, 2014 4:16:41 PM (11 years ago)
Author:
vboxsync
Message:

6183 src-all/PCIDeviceAttachmentImpl.cpp

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

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

    r46373 r50922  
    2121#define ____H_PCIDEVICEATTACHMENTIMPL
    2222
    23 #include "VirtualBoxBase.h"
     23#include "PCIDeviceAttachmentWrap.h"
    2424#include <VBox/settings.h>
    2525
    2626class ATL_NO_VTABLE PCIDeviceAttachment :
    27     public VirtualBoxBase,
    28     VBOX_SCRIPTABLE_IMPL(IPCIDeviceAttachment)
     27    public PCIDeviceAttachmentWrap
    2928{
    3029public:
    31     VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(PCIDeviceAttachment, IPCIDeviceAttachment)
    3230
    33     DECLARE_NOT_AGGREGATABLE(PCIDeviceAttachment)
    34 
    35     DECLARE_PROTECT_FINAL_CONSTRUCT()
    36 
    37     BEGIN_COM_MAP(PCIDeviceAttachment)
    38         VBOX_DEFAULT_INTERFACE_ENTRIES(IPCIDeviceAttachment)
    39     END_COM_MAP()
    40 
    41     PCIDeviceAttachment() { }
    42     ~PCIDeviceAttachment() { }
     31    DECLARE_EMPTY_CTOR_DTOR(PCIDeviceAttachment)
    4332
    4433    // public initializer/uninitializer for internal purposes only
     
    5241
    5342    // settings
    54     HRESULT loadSettings(IMachine * aParent,
    55                          const settings::HostPCIDeviceAttachment& aHpda);
    56     HRESULT saveSettings(settings::HostPCIDeviceAttachment &data);
     43    HRESULT i_loadSettings(IMachine * aParent,
     44                           const settings::HostPCIDeviceAttachment& aHpda);
     45    HRESULT i_saveSettings(settings::HostPCIDeviceAttachment &data);
    5746
    5847    HRESULT FinalConstruct();
    5948    void FinalRelease();
    6049
    61     // IPCIDeviceAttachment properties
    62     STDMETHOD(COMGETTER(Name))(BSTR * aName);
    63     STDMETHOD(COMGETTER(IsPhysicalDevice))(BOOL * aPhysical);
    64     STDMETHOD(COMGETTER(HostAddress))(LONG  * hostAddress);
    65     STDMETHOD(COMGETTER(GuestAddress))(LONG * guestAddress);
     50private:
    6651
    67 private:
     52    // wrapped IPCIDeviceAttachment properties
     53    HRESULT getName(com::Utf8Str &aName);
     54    HRESULT getIsPhysicalDevice(BOOL *aIsPhysicalDevice);
     55    HRESULT getHostAddress(LONG *aHostAddress);
     56    HRESULT getGuestAddress(LONG *aGuestAddress);
     57
    6858    struct Data;
    6959    Data*  m;
  • trunk/src/VBox/Main/src-all/PCIDeviceAttachmentImpl.cpp

    r42551 r50922  
    4343// constructor / destructor
    4444/////////////////////////////////////////////////////////////////////////////
     45DEFINE_EMPTY_CTOR_DTOR(PCIDeviceAttachment)
    4546
    4647HRESULT PCIDeviceAttachment::FinalConstruct()
     
    7172}
    7273
    73 HRESULT PCIDeviceAttachment::loadSettings(IMachine *aParent,
    74                                           const settings::HostPCIDeviceAttachment &hpda)
     74HRESULT PCIDeviceAttachment::i_loadSettings(IMachine *aParent,
     75                                            const settings::HostPCIDeviceAttachment &hpda)
    7576{
    7677    Bstr bname(hpda.strDeviceName);
     
    7980
    8081
    81 HRESULT PCIDeviceAttachment::saveSettings(settings::HostPCIDeviceAttachment &data)
     82HRESULT PCIDeviceAttachment::i_saveSettings(settings::HostPCIDeviceAttachment &data)
    8283{
    8384    Assert(m);
     
    104105// IPCIDeviceAttachment properties
    105106/////////////////////////////////////////////////////////////////////////////
    106 
    107 STDMETHODIMP PCIDeviceAttachment::COMGETTER(Name)(BSTR * aName)
     107HRESULT PCIDeviceAttachment::getName(com::Utf8Str &aName)
    108108{
    109     CheckComArgOutPointerValid(aName);
    110     m->DevName.cloneTo(aName);
     109    aName = m->DevName;
    111110    return S_OK;
    112111}
    113112
    114 STDMETHODIMP PCIDeviceAttachment::COMGETTER(IsPhysicalDevice)(BOOL * aPhysical)
     113HRESULT PCIDeviceAttachment::getIsPhysicalDevice(BOOL *aIsPhysicalDevice)
    115114{
    116     CheckComArgOutPointerValid(aPhysical);
    117     *aPhysical = m->fPhysical;
     115    *aIsPhysicalDevice = m->fPhysical;
    118116    return S_OK;
    119117}
    120118
    121 STDMETHODIMP PCIDeviceAttachment::COMGETTER(HostAddress)(LONG * aHostAddress)
     119HRESULT PCIDeviceAttachment::getHostAddress(LONG *aHostAddress)
    122120{
    123121    *aHostAddress = m->HostAddress;
    124122    return S_OK;
    125123}
    126 
    127 STDMETHODIMP PCIDeviceAttachment::COMGETTER(GuestAddress)(LONG * aGuestAddress)
     124HRESULT PCIDeviceAttachment::getGuestAddress(LONG *aGuestAddress)
    128125{
    129126    *aGuestAddress = m->GuestAddress;
    130127    return S_OK;
    131128}
    132 
    133 #ifdef VBOX_WITH_XPCOM
    134 NS_DECL_CLASSINFO(PCIDeviceAttachment)
    135 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(PCIDeviceAttachment, IPCIDeviceAttachment)
    136 #endif
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r50919 r50922  
    94989498
    94999499            pda.createObject();
    9500             pda->loadSettings(this, hpda);
     9500            pda->i_loadSettings(this, hpda);
    95019501            mHWData->mPCIDeviceAssignments.push_back(pda);
    95029502        }
     
    1079110791            settings::HostPCIDeviceAttachment hpda;
    1079210792
    10793             rc = pda->saveSettings(hpda);
     10793            rc = pda->i_saveSettings(hpda);
    1079410794            if (FAILED(rc)) throw rc;
    1079510795
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