1 | /* $Id: StorageControllerImpl.h 101220 2023-09-21 10:51:17Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | *
|
---|
5 | * VBox StorageController COM Class declaration.
|
---|
6 | */
|
---|
7 |
|
---|
8 | /*
|
---|
9 | * Copyright (C) 2008-2023 Oracle and/or its affiliates.
|
---|
10 | *
|
---|
11 | * This file is part of VirtualBox base platform packages, as
|
---|
12 | * available from https://www.virtualbox.org.
|
---|
13 | *
|
---|
14 | * This program is free software; you can redistribute it and/or
|
---|
15 | * modify it under the terms of the GNU General Public License
|
---|
16 | * as published by the Free Software Foundation, in version 3 of the
|
---|
17 | * License.
|
---|
18 | *
|
---|
19 | * This program is distributed in the hope that it will be useful, but
|
---|
20 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
22 | * General Public License for more details.
|
---|
23 | *
|
---|
24 | * You should have received a copy of the GNU General Public License
|
---|
25 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
26 | *
|
---|
27 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
28 | */
|
---|
29 |
|
---|
30 | #ifndef MAIN_INCLUDED_StorageControllerImpl_h
|
---|
31 | #define MAIN_INCLUDED_StorageControllerImpl_h
|
---|
32 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
33 | # pragma once
|
---|
34 | #endif
|
---|
35 | #include "StorageControllerWrap.h"
|
---|
36 |
|
---|
37 | class ATL_NO_VTABLE StorageController :
|
---|
38 | public StorageControllerWrap
|
---|
39 | {
|
---|
40 | public:
|
---|
41 |
|
---|
42 | DECLARE_COMMON_CLASS_METHODS(StorageController)
|
---|
43 |
|
---|
44 | HRESULT FinalConstruct();
|
---|
45 | void FinalRelease();
|
---|
46 |
|
---|
47 | // public initializer/uninitializer for internal purposes only
|
---|
48 | HRESULT init(Machine *aParent,
|
---|
49 | const com::Utf8Str &aName,
|
---|
50 | StorageBus_T aBus,
|
---|
51 | ULONG aInstance,
|
---|
52 | bool fBootable);
|
---|
53 | HRESULT init(Machine *aParent,
|
---|
54 | StorageController *aThat,
|
---|
55 | bool aReshare = false);
|
---|
56 | HRESULT initCopy(Machine *aParent,
|
---|
57 | StorageController *aThat);
|
---|
58 | void uninit();
|
---|
59 |
|
---|
60 | // public methods only for internal purposes
|
---|
61 | const Utf8Str &i_getName() const;
|
---|
62 | StorageControllerType_T i_getControllerType() const;
|
---|
63 | StorageBus_T i_getStorageBus() const;
|
---|
64 | ULONG i_getInstance() const;
|
---|
65 | bool i_getBootable() const;
|
---|
66 | HRESULT i_checkPortAndDeviceValid(LONG aControllerPort,
|
---|
67 | LONG aDevice);
|
---|
68 | void i_setBootable(BOOL fBootable);
|
---|
69 | void i_rollback();
|
---|
70 | void i_commit();
|
---|
71 |
|
---|
72 | // public methods for internal purposes only
|
---|
73 | // (ensure there is a caller and a read lock before calling them!)
|
---|
74 |
|
---|
75 | void i_unshare();
|
---|
76 |
|
---|
77 | // public static methods
|
---|
78 | static com::Utf8Str i_controllerNameFromBusType(StorageBus_T aBusType);
|
---|
79 |
|
---|
80 | /** @note this doesn't require a read lock since mParent is constant. */
|
---|
81 | Machine* i_getMachine();
|
---|
82 | ComObjPtr<StorageController> i_getPeer();
|
---|
83 |
|
---|
84 | private:
|
---|
85 |
|
---|
86 | // Wrapped IStorageController properties
|
---|
87 | HRESULT getName(com::Utf8Str &aName);
|
---|
88 | HRESULT setName(const com::Utf8Str &aName);
|
---|
89 | HRESULT getMaxDevicesPerPortCount(ULONG *aMaxDevicesPerPortCount);
|
---|
90 | HRESULT getMinPortCount(ULONG *aMinPortCount);
|
---|
91 | HRESULT getMaxPortCount(ULONG *aMaxPortCount);
|
---|
92 | HRESULT getInstance(ULONG *aInstance);
|
---|
93 | HRESULT setInstance(ULONG aInstance);
|
---|
94 | HRESULT getPortCount(ULONG *aPortCount);
|
---|
95 | HRESULT setPortCount(ULONG aPortCount);
|
---|
96 | HRESULT getBus(StorageBus_T *aBus);
|
---|
97 | HRESULT getControllerType(StorageControllerType_T *aControllerType);
|
---|
98 | HRESULT setControllerType(StorageControllerType_T aControllerType);
|
---|
99 | HRESULT getUseHostIOCache(BOOL *aUseHostIOCache);
|
---|
100 | HRESULT setUseHostIOCache(BOOL aUseHostIOCache);
|
---|
101 | HRESULT getBootable(BOOL *aBootable);
|
---|
102 |
|
---|
103 | void i_printList();
|
---|
104 |
|
---|
105 | struct Data;
|
---|
106 | Data *m;
|
---|
107 | };
|
---|
108 |
|
---|
109 | #endif /* !MAIN_INCLUDED_StorageControllerImpl_h */
|
---|
110 | /* vi: set tabstop=4 shiftwidth=4 expandtab: */
|
---|