VirtualBox

source: vbox/trunk/src/VBox/Main/include/StorageControllerImpl.h@ 28764

Last change on this file since 28764 was 28764, checked in by vboxsync, 15 years ago

Main: Introduce a per controller setting to switch to the unbuffered async I/O interface (UseNewIo). Configurable through VBoxManage, default is still buffered

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.9 KB
Line 
1/* $Id: StorageControllerImpl.h 28764 2010-04-26 16:12:49Z vboxsync $ */
2
3/** @file
4 *
5 * VBox StorageController COM Class declaration.
6 */
7
8/*
9 * Copyright (C) 2008 Sun Microsystems, Inc.
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 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
20 * Clara, CA 95054 USA or visit http://www.sun.com if you need
21 * additional information or have any questions.
22 */
23
24#ifndef ____H_STORAGECONTROLLERIMPL
25#define ____H_STORAGECONTROLLERIMPL
26
27#include "VirtualBoxBase.h"
28
29class ATL_NO_VTABLE StorageController :
30 public VirtualBoxBase,
31 public VirtualBoxSupportErrorInfoImpl<StorageController, IStorageController>,
32 public VirtualBoxSupportTranslation<StorageController>,
33 VBOX_SCRIPTABLE_IMPL(IStorageController)
34{
35public:
36
37 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (StorageController)
38
39 DECLARE_NOT_AGGREGATABLE (StorageController)
40
41 DECLARE_PROTECT_FINAL_CONSTRUCT()
42
43 BEGIN_COM_MAP(StorageController)
44 COM_INTERFACE_ENTRY (ISupportErrorInfo)
45 COM_INTERFACE_ENTRY (IStorageController)
46 COM_INTERFACE_ENTRY2 (IDispatch, IStorageController)
47 END_COM_MAP()
48
49 StorageController() { };
50 ~StorageController() { };
51
52 HRESULT FinalConstruct();
53 void FinalRelease();
54
55 // public initializer/uninitializer for internal purposes only
56 HRESULT init(Machine *aParent,
57 const Utf8Str &aName,
58 StorageBus_T aBus,
59 ULONG aInstance);
60 HRESULT init(Machine *aParent,
61 StorageController *aThat,
62 bool aReshare = false);
63 HRESULT initCopy(Machine *aParent,
64 StorageController *aThat);
65 void uninit();
66
67 // IStorageController properties
68 STDMETHOD(COMGETTER(Name)) (BSTR *aName);
69 STDMETHOD(COMGETTER(Bus)) (StorageBus_T *aBus);
70 STDMETHOD(COMGETTER(ControllerType)) (StorageControllerType_T *aControllerType);
71 STDMETHOD(COMSETTER(ControllerType)) (StorageControllerType_T aControllerType);
72 STDMETHOD(COMGETTER(MaxDevicesPerPortCount)) (ULONG *aMaxDevices);
73 STDMETHOD(COMGETTER(MinPortCount)) (ULONG *aMinPortCount);
74 STDMETHOD(COMGETTER(MaxPortCount)) (ULONG *aMaxPortCount);
75 STDMETHOD(COMGETTER(PortCount)) (ULONG *aPortCount);
76 STDMETHOD(COMSETTER(PortCount)) (ULONG aPortCount);
77 STDMETHOD(COMGETTER(Instance)) (ULONG *aInstance);
78 STDMETHOD(COMSETTER(Instance)) (ULONG aInstance);
79 STDMETHOD(COMGETTER(IoBackend)) (IoBackendType_T *aIoBackend);
80 STDMETHOD(COMSETTER(IoBackend)) (IoBackendType_T aIoBackend);
81
82 // StorageController methods
83 STDMETHOD(GetIDEEmulationPort) (LONG DevicePosition, LONG *aPortNumber);
84 STDMETHOD(SetIDEEmulationPort) (LONG DevicePosition, LONG aPortNumber);
85
86 // public methods only for internal purposes
87
88 const Utf8Str &getName() const;
89 StorageControllerType_T getControllerType() const;
90 StorageBus_T getStorageBus() const;
91 ULONG getInstance() const;
92
93 void rollback();
94 void commit();
95
96 // public methods for internal purposes only
97 // (ensure there is a caller and a read lock before calling them!)
98
99 void unshare();
100
101 /** @note this doesn't require a read lock since mParent is constant. */
102 Machine* getMachine();
103
104 ComObjPtr<StorageController> getPeer();
105
106 // for VirtualBoxSupportErrorInfoImpl
107 static const wchar_t *getComponentName() { return L"StorageController"; }
108
109private:
110
111 void printList();
112
113 struct Data;
114 Data *m;
115};
116
117#endif //!____H_STORAGECONTROLLERIMPL
118/* vi: set tabstop=4 shiftwidth=4 expandtab: */
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