StorageControllerImpl.h revision 57b49c1557a310ee615bc0ee79dd2a2e92319a1b
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync * VBox StorageController COM Class declaration.
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync * Copyright (C) 2008 Sun Microsystems, Inc.
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 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync * additional information or have any questions.
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync public VirtualBoxSupportErrorInfoImpl <StorageController, IStorageController>,
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync public VirtualBoxSupportTranslation <StorageController>,
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync /* Constructor. */
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync mStorageControllerType (StorageControllerType_PIIX4),
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync return this == &that || ((mStorageControllerType == that.mStorageControllerType) &&
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync /** Uniuqe name of the storage controller. */
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync /** The connection type of thestorage controller. */
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync /** Type of the Storage controller. */
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync /** Number of usable ports. */
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync /** The following is only for the SATA controller atm. */
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync /** Port which acts as primary master for ide emulation. */
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync /** Port which acts as primary slave for ide emulation. */
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync /** Port which acts as secondary master for ide emulation. */
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync /** Port which acts as secondary slave for ide emulation. */
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (StorageController)
57b49c1557a310ee615bc0ee79dd2a2e92319a1bvboxsync COM_INTERFACE_ENTRY2 (IDispatch, IStorageController)
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync // public initializer/uninitializer for internal purposes only
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync HRESULT init (Machine *aParent, StorageController *aThat, bool aReshare = false);
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync HRESULT initCopy (Machine *aParent, StorageController *aThat);
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync // IStorageController properties
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync STDMETHOD(COMGETTER(ControllerType)) (StorageControllerType_T *aControllerType);
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync STDMETHOD(COMSETTER(ControllerType)) (StorageControllerType_T aControllerType);
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync STDMETHOD(COMGETTER(MaxDevicesPerPortCount)) (ULONG *aMaxDevices);
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync STDMETHOD(COMGETTER(MinPortCount)) (ULONG *aMinPortCount);
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync STDMETHOD(COMGETTER(MaxPortCount)) (ULONG *aMaxPortCount);
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync STDMETHOD(COMGETTER(PortCount)) (ULONG *aPortCount);
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync STDMETHOD(COMSETTER(PortCount)) (ULONG aPortCount);
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync // StorageController methods
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync STDMETHOD(GetIDEEmulationPort) (LONG DevicePosition, LONG *aPortNumber);
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync STDMETHOD(SetIDEEmulationPort) (LONG DevicePosition, LONG aPortNumber);
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync // public methods only for internal purposes
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync StorageControllerType_T controllerType() const { return mData->mStorageControllerType; }
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync bool isModified() { AutoWriteLock alock (this); return mData.isBackedUp(); }
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync bool isReallyModified() { AutoWriteLock alock (this); return mData.hasActualChanges(); }
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync // public methods for internal purposes only
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync // (ensure there is a caller and a read lock before calling them!)
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync /** @note this doesn't require a read lock since mParent is constant. */
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync const ComObjPtr <Machine, ComWeakRef> &parent() { return mParent; };
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync ComObjPtr <StorageController> peer() { return mPeer; }
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync // for VirtualBoxSupportErrorInfoImpl
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync static const wchar_t *getComponentName() { return L"StorageController"; }
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync /** Parent object. */
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync /** Peer object. */
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync /** Data. */
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync /* Instance number of the device in the running VM. */
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync#endif //!____H_STORAGECONTROLLERIMPL
7189dad3705d42e9874af1e1c8a8c7e5cceee9f7vboxsync/* vi: set tabstop=4 shiftwidth=4 expandtab: */