VirtualBox

source: vbox/trunk/src/VBox/Main/include/PciDeviceAttachmentImpl.h@ 34575

Last change on this file since 34575 was 34331, checked in by vboxsync, 14 years ago

PCI: more 4.0 interfaces

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.3 KB
Line 
1/* $Id: PciDeviceAttachmentImpl.h 34331 2010-11-24 16:24:17Z vboxsync $ */
2
3/** @file
4 *
5 * PCI attachment information implmentation.
6 */
7
8/*
9 * Copyright (C) 2010 Oracle Corporation
10 *
11 * This file is part of VirtualBox Open Source Edition (OSE), as
12 * available from http://www.virtualbox.org. This file is free software;
13 * you can redistribute it and/or modify it under the terms of the GNU
14 * General Public License (GPL) as published by the Free Software
15 * Foundation, in version 2 as it comes in the "COPYING" file of the
16 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
17 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
18 */
19
20#ifndef ____H_PCIDEVICEATTACHMENTIMPL
21#define ____H_PCIDEVICEATTACHMENTIMPL
22
23#include "VirtualBoxBase.h"
24
25class ATL_NO_VTABLE PciAddress :
26 public VirtualBoxBase,
27 VBOX_SCRIPTABLE_IMPL(IPciAddress)
28{
29public:
30 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(PciAddress, IPciAddress)
31
32 DECLARE_NOT_AGGREGATABLE(PciAddress)
33
34 DECLARE_PROTECT_FINAL_CONSTRUCT()
35
36 BEGIN_COM_MAP(PciAddress)
37 COM_INTERFACE_ENTRY(ISupportErrorInfo)
38 COM_INTERFACE_ENTRY(IPciAddress)
39 COM_INTERFACE_ENTRY(IDispatch)
40 END_COM_MAP()
41
42 PciAddress() { }
43 ~PciAddress() { }
44
45 // public initializer/uninitializer for internal purposes only
46 HRESULT init(LONG aAddess);
47 void uninit();
48
49 HRESULT FinalConstruct();
50 void FinalRelease();
51
52 // IPciAddress properties
53 STDMETHOD(COMGETTER(Bus))(SHORT *aBus)
54 {
55 *aBus = mBus;
56 return S_OK;
57 }
58 STDMETHOD(COMSETTER(Bus))(SHORT aBus)
59 {
60 mBus = aBus;
61 return S_OK;
62 }
63 STDMETHOD(COMGETTER(Device))(SHORT *aDevice)
64 {
65 *aDevice = mDevice;
66 return S_OK;
67 }
68 STDMETHOD(COMSETTER(Device))(SHORT aDevice)
69 {
70 mDevice = aDevice;
71 return S_OK;
72 }
73
74 STDMETHOD(COMGETTER(DevFunction))(SHORT *aDevFunction)
75 {
76 *aDevFunction = mFn;
77 return S_OK;
78 }
79 STDMETHOD(COMSETTER(DevFunction))(SHORT aDevFunction)
80 {
81 mFn = aDevFunction;
82 return S_OK;
83 }
84
85private:
86 SHORT mBus, mDevice, mFn;
87};
88
89class ATL_NO_VTABLE PciDeviceAttachment :
90 public VirtualBoxBase,
91 VBOX_SCRIPTABLE_IMPL(IPciDeviceAttachment)
92{
93public:
94 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(PciDeviceAttachment, IPciDeviceAttachment)
95
96 DECLARE_NOT_AGGREGATABLE(PciDeviceAttachment)
97
98 DECLARE_PROTECT_FINAL_CONSTRUCT()
99
100 BEGIN_COM_MAP(PciDeviceAttachment)
101 COM_INTERFACE_ENTRY(ISupportErrorInfo)
102 COM_INTERFACE_ENTRY(IPciDeviceAttachment)
103 COM_INTERFACE_ENTRY(IDispatch)
104 END_COM_MAP()
105
106 PciDeviceAttachment() { }
107 ~PciDeviceAttachment() { }
108
109 // public initializer/uninitializer for internal purposes only
110 HRESULT init(Machine * aParent,
111 const Bstr &aName,
112 LONG aHostAddess,
113 LONG aGuestAddress,
114 BOOL fPhysical);
115 void uninit();
116
117 HRESULT FinalConstruct();
118 void FinalRelease();
119
120 // IPciDeviceAttachment properties
121 STDMETHOD(COMGETTER(Name))(BSTR * aName);
122 STDMETHOD(COMGETTER(IsPhysicalDevice))(BOOL * aPhysical);
123 STDMETHOD(COMGETTER(HostAddress))(LONG * hostAddress);
124 STDMETHOD(COMGETTER(GuestAddress))(LONG * guestAddress);
125
126private:
127 struct Data;
128 Data *m;
129};
130
131#endif // ____H_PCIDEVICEATTACHMENTIMPL
Note: See TracBrowser for help on using the repository browser.

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