VirtualBox

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

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

Main: remove SupportErrorInfo template magic

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1/* $Id: StorageControllerImpl.h 30714 2010-07-07 16:20:03Z vboxsync $ */
2
3/** @file
4 *
5 * VBox StorageController COM Class declaration.
6 */
7
8/*
9 * Copyright (C) 2008 Oracle Corporation
10 *
11 * This file is part of VirtualBox Open Source Edition (OSE), as
12 * available from http://www.215389.xyz. 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_STORAGECONTROLLERIMPL
21#define ____H_STORAGECONTROLLERIMPL
22
23#include "VirtualBoxBase.h"
24
25class ATL_NO_VTABLE StorageController :
26 public VirtualBoxBase,
27 public VirtualBoxSupportTranslation<StorageController>,
28 VBOX_SCRIPTABLE_IMPL(IStorageController)
29{
30public:
31
32 VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(StorageController, IStorageController)
33
34 DECLARE_NOT_AGGREGATABLE (StorageController)
35
36 DECLARE_PROTECT_FINAL_CONSTRUCT()
37
38 BEGIN_COM_MAP(StorageController)
39 COM_INTERFACE_ENTRY (ISupportErrorInfo)
40 COM_INTERFACE_ENTRY (IStorageController)
41 COM_INTERFACE_ENTRY2 (IDispatch, IStorageController)
42 END_COM_MAP()
43
44 StorageController() { };
45 ~StorageController() { };
46
47 HRESULT FinalConstruct();
48 void FinalRelease();
49
50 // public initializer/uninitializer for internal purposes only
51 HRESULT init(Machine *aParent,
52 const Utf8Str &aName,
53 StorageBus_T aBus,
54 ULONG aInstance);
55 HRESULT init(Machine *aParent,
56 StorageController *aThat,
57 bool aReshare = false);
58 HRESULT initCopy(Machine *aParent,
59 StorageController *aThat);
60 void uninit();
61
62 // IStorageController properties
63 STDMETHOD(COMGETTER(Name)) (BSTR *aName);
64 STDMETHOD(COMGETTER(Bus)) (StorageBus_T *aBus);
65 STDMETHOD(COMGETTER(ControllerType)) (StorageControllerType_T *aControllerType);
66 STDMETHOD(COMSETTER(ControllerType)) (StorageControllerType_T aControllerType);
67 STDMETHOD(COMGETTER(MaxDevicesPerPortCount)) (ULONG *aMaxDevices);
68 STDMETHOD(COMGETTER(MinPortCount)) (ULONG *aMinPortCount);
69 STDMETHOD(COMGETTER(MaxPortCount)) (ULONG *aMaxPortCount);
70 STDMETHOD(COMGETTER(PortCount)) (ULONG *aPortCount);
71 STDMETHOD(COMSETTER(PortCount)) (ULONG aPortCount);
72 STDMETHOD(COMGETTER(Instance)) (ULONG *aInstance);
73 STDMETHOD(COMSETTER(Instance)) (ULONG aInstance);
74 STDMETHOD(COMGETTER(UseHostIOCache)) (BOOL *fUseHostIOCache);
75 STDMETHOD(COMSETTER(UseHostIOCache)) (BOOL fUseHostIOCache);
76
77 // StorageController methods
78 STDMETHOD(GetIDEEmulationPort) (LONG DevicePosition, LONG *aPortNumber);
79 STDMETHOD(SetIDEEmulationPort) (LONG DevicePosition, LONG aPortNumber);
80
81 // public methods only for internal purposes
82
83 const Utf8Str &getName() const;
84 StorageControllerType_T getControllerType() const;
85 StorageBus_T getStorageBus() const;
86 ULONG getInstance() const;
87
88 void rollback();
89 void commit();
90
91 // public methods for internal purposes only
92 // (ensure there is a caller and a read lock before calling them!)
93
94 void unshare();
95
96 /** @note this doesn't require a read lock since mParent is constant. */
97 Machine* getMachine();
98
99 ComObjPtr<StorageController> getPeer();
100
101private:
102
103 void printList();
104
105 struct Data;
106 Data *m;
107};
108
109#endif //!____H_STORAGECONTROLLERIMPL
110/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

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