VirtualBox

source: vbox/trunk/src/VBox/Main/include/MediumAttachmentImpl.h

Last change on this file was 98103, checked in by vboxsync, 16 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 4.7 KB
RevLine 
[69474]1/* $Id: MediumAttachmentImpl.h 98103 2023-01-17 14:15:46Z vboxsync $ */
[23265]2/** @file
3 *
4 * VirtualBox COM class implementation
5 */
6
7/*
[98103]8 * Copyright (C) 2006-2023 Oracle and/or its affiliates.
[23265]9 *
[96407]10 * This file is part of VirtualBox base platform packages, as
11 * available from https://www.virtualbox.org.
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation, in version 3 of the
16 * License.
17 *
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, see <https://www.gnu.org/licenses>.
25 *
26 * SPDX-License-Identifier: GPL-3.0-only
[23265]27 */
28
[76562]29#ifndef MAIN_INCLUDED_MediumAttachmentImpl_h
30#define MAIN_INCLUDED_MediumAttachmentImpl_h
[76487]31#ifndef RT_WITHOUT_PRAGMA_ONCE
32# pragma once
33#endif
[23265]34
[49871]35#include "MediumAttachmentWrap.h"
[23265]36
37class ATL_NO_VTABLE MediumAttachment :
[49871]38 public MediumAttachmentWrap
[23265]39{
40public:
41
[90828]42 DECLARE_COMMON_CLASS_METHODS(MediumAttachment)
[23265]43
[49871]44 HRESULT FinalConstruct();
45 void FinalRelease();
[23265]46
47 // public initializer/uninitializer for internal purposes only
[23394]48 HRESULT init(Machine *aParent,
[23265]49 Medium *aMedium,
[56820]50 const Utf8Str &aControllerName,
[23265]51 LONG aPort,
52 LONG aDevice,
53 DeviceType_T aType,
[65103]54 bool aImplicit,
55 bool aPassthrough,
56 bool aTempEject,
57 bool aNonRotational,
58 bool aDiscard,
59 bool aHotPluggable,
[36058]60 const Utf8Str &strBandwidthGroup);
[38718]61 HRESULT initCopy(Machine *aParent, MediumAttachment *aThat);
[23265]62 void uninit();
63
[25200]64 // public internal methods
[49871]65 void i_rollback();
66 void i_commit();
[25200]67
68 // unsafe public methods for internal purposes only (ensure there is
[23265]69 // a caller and a read lock before calling them!)
[49871]70 bool i_isImplicit() const;
71 void i_setImplicit(bool aImplicit);
[23265]72
[49871]73 const ComObjPtr<Medium>& i_getMedium() const;
[56820]74 const Utf8Str &i_getControllerName() const;
[49871]75 LONG i_getPort() const;
76 LONG i_getDevice() const;
77 DeviceType_T i_getType() const;
78 bool i_getPassthrough() const;
79 bool i_getTempEject() const;
80 bool i_getNonRotational() const;
81 bool i_getDiscard() const;
82 Utf8Str& i_getBandwidthGroup() const;
83 bool i_getHotPluggable() const;
[23265]84
[56820]85 bool i_matches(const Utf8Str &aControllerName, LONG aPort, LONG aDevice);
[23265]86
87 /** Must be called from under this object's write lock. */
[56820]88 void i_updateName(const Utf8Str &aName);
89
90 /** Must be called from under this object's write lock. */
[49871]91 void i_updateMedium(const ComObjPtr<Medium> &aMedium);
[23265]92
[23928]93 /** Must be called from under this object's write lock. */
[49871]94 void i_updatePassthrough(bool aPassthrough);
[23928]95
[34587]96 /** Must be called from under this object's write lock. */
[49871]97 void i_updateTempEject(bool aTempEject);
[37709]98
99 /** Must be called from under this object's write lock. */
[49871]100 void i_updateNonRotational(bool aNonRotational);
[37824]101
102 /** Must be called from under this object's write lock. */
[49871]103 void i_updateDiscard(bool aDiscard);
[38873]104
105 /** Must be called from under this object's write lock. */
[49871]106 void i_updateEjected();
[37695]107
108 /** Must be called from under this object's write lock. */
[49871]109 void i_updateBandwidthGroup(const Utf8Str &aBandwidthGroup);
[34587]110
[49871]111 void i_updateParentMachine(Machine * const pMachine);
[36181]112
[48879]113 /** Must be called from under this object's write lock. */
[49871]114 void i_updateHotPluggable(bool aHotPluggable);
[48879]115
[61713]116 /** Construct a unique and somewhat descriptive name for logging. */
117 void i_updateLogName(void);
118
[24934]119 /** Get a unique and somewhat descriptive name for logging. */
[61713]120 const char *i_getLogName(void) const { return mLogName.c_str(); }
[24934]121
[23265]122private:
[49871]123
124 // Wrapped IMediumAttachment properties
[78786]125 HRESULT getMachine(ComPtr<IMachine> &aMachine);
[49871]126 HRESULT getMedium(ComPtr<IMedium> &aHardDisk);
127 HRESULT getController(com::Utf8Str &aController);
128 HRESULT getPort(LONG *aPort);
129 HRESULT getDevice(LONG *aDevice);
130 HRESULT getType(DeviceType_T *aType);
131 HRESULT getPassthrough(BOOL *aPassthrough);
132 HRESULT getTemporaryEject(BOOL *aTemporaryEject);
133 HRESULT getIsEjected(BOOL *aEjected);
134 HRESULT getDiscard(BOOL *aDiscard);
135 HRESULT getNonRotational(BOOL *aNonRotational);
136 HRESULT getBandwidthGroup(ComPtr<IBandwidthGroup> &aBandwidthGroup);
137 HRESULT getHotPluggable(BOOL *aHotPluggable);
138
[25200]139 struct Data;
140 Data *m;
[23265]141
[24934]142 Utf8Str mLogName; /**< For logging purposes */
[23265]143};
144
[76562]145#endif /* !MAIN_INCLUDED_MediumAttachmentImpl_h */
[23265]146/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use