StorageControllerImpl.h revision 7b01db654c23d4e432465aebc1a1853e8d6b3194
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync/* $Id$ */
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync/** @file
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync *
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync * VBox StorageController COM Class declaration.
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync */
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync/*
e64031e20c39650a7bc902a3e1aba613b9415deevboxsync * Copyright (C) 2008-2013 Oracle Corporation
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync *
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync * available from http://www.virtualbox.org. This file is free software;
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync * you can redistribute it and/or modify it under the terms of the GNU
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync * General Public License (GPL) as published by the Free Software
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync */
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync#ifndef ____H_STORAGECONTROLLERIMPL
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync#define ____H_STORAGECONTROLLERIMPL
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync#include "StorageControllerWrap.h"
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsyncclass ATL_NO_VTABLE StorageController :
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync public StorageControllerWrap
168d8e5243c71b5d181b789b3b6370ae562c5d0bvboxsync{
0ce6ae9d6efed5d54222a13bbdabce9e688e4447vboxsyncpublic:
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync DECLARE_EMPTY_CTOR_DTOR(StorageController)
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
e07acfb7f2dbb8bb40804024c79fd3139bdb3f24vboxsync HRESULT FinalConstruct();
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync void FinalRelease();
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync // public initializer/uninitializer for internal purposes only
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync HRESULT init(Machine *aParent,
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync const Utf8Str &aName,
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync StorageBus_T aBus,
57b49c1557a310ee615bc0ee79dd2a2e92319a1bvboxsync ULONG aInstance,
57b49c1557a310ee615bc0ee79dd2a2e92319a1bvboxsync bool fBootable);
57b49c1557a310ee615bc0ee79dd2a2e92319a1bvboxsync HRESULT init(Machine *aParent,
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync StorageController *aThat,
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync bool aReshare = false);
4182d14dc02dba6587c15e358b87e5c9a6e60d15vboxsync HRESULT initCopy(Machine *aParent,
4182d14dc02dba6587c15e358b87e5c9a6e60d15vboxsync StorageController *aThat);
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync void uninit();
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync // public methods only for internal purposes
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync const Utf8Str &i_getName() const;
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync StorageControllerType_T i_getControllerType() const;
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync StorageBus_T i_getStorageBus() const;
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync ULONG i_getInstance() const;
c8faf7a704e698dec3679d7df43ae55b1bab3eadvboxsync bool i_getBootable() const;
bf88068260ded16af90b7da4867240fbdd9c8017vboxsync HRESULT i_checkPortAndDeviceValid(LONG aControllerPort,
bf88068260ded16af90b7da4867240fbdd9c8017vboxsync LONG aDevice);
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync void i_setBootable(BOOL fBootable);
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync void i_rollback();
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync void i_commit();
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync HRESULT i_getIDEEmulationPort (LONG DevicePosition, LONG *aPortNumber);
fe06619ae576367ff3568e6abd99fb8ad28cc73avboxsync HRESULT i_setIDEEmulationPort (LONG DevicePosition, LONG aPortNumber);
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync // public methods for internal purposes only
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync // (ensure there is a caller and a read lock before calling them!)
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync void i_unshare();
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync /** @note this doesn't require a read lock since mParent is constant. */
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync Machine* i_getMachine();
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync ComObjPtr<StorageController> i_getPeer();
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsyncprivate:
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync // Wrapped IStorageController properties
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync HRESULT getName(com::Utf8Str &aName);
aceec09dd145a4d6fb14f2ea75a459cc88b334abvboxsync HRESULT getMaxDevicesPerPortCount(ULONG *aMaxDevicesPerPortCount);
aceec09dd145a4d6fb14f2ea75a459cc88b334abvboxsync HRESULT getMinPortCount(ULONG *aMinPortCount);
bf88068260ded16af90b7da4867240fbdd9c8017vboxsync HRESULT getMaxPortCount(ULONG *aMaxPortCount);
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync HRESULT getInstance(ULONG *aInstance);
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync HRESULT setInstance(ULONG aInstance);
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync HRESULT getPortCount(ULONG *aPortCount);
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync HRESULT setPortCount(ULONG aPortCount);
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync HRESULT getBus(StorageBus_T *aBus);
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync HRESULT getControllerType(StorageControllerType_T *aControllerType);
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync HRESULT setControllerType(StorageControllerType_T aControllerType);
4182d14dc02dba6587c15e358b87e5c9a6e60d15vboxsync HRESULT getUseHostIOCache(BOOL *aUseHostIOCache);
4182d14dc02dba6587c15e358b87e5c9a6e60d15vboxsync HRESULT setUseHostIOCache(BOOL aUseHostIOCache);
4182d14dc02dba6587c15e358b87e5c9a6e60d15vboxsync HRESULT getBootable(BOOL *aBootable);
4182d14dc02dba6587c15e358b87e5c9a6e60d15vboxsync
bf88068260ded16af90b7da4867240fbdd9c8017vboxsync void i_printList();
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync
cda7cecf60d1d5f9fc5b671f7a541bc5542dfdd7vboxsync struct Data;
cda7cecf60d1d5f9fc5b671f7a541bc5542dfdd7vboxsync Data *m;
cda7cecf60d1d5f9fc5b671f7a541bc5542dfdd7vboxsync};
bf88068260ded16af90b7da4867240fbdd9c8017vboxsync
bf88068260ded16af90b7da4867240fbdd9c8017vboxsync#endif //!____H_STORAGECONTROLLERIMPL
f55abd25f4f8302c7314d4af12005e6c2b98061avboxsync/* vi: set tabstop=4 shiftwidth=4 expandtab: */
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync