MediumImpl.h revision eeab73cfabc939c13e9e2491035489cf2a027570
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync/* $Id$ */
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync/** @file
35473cad6d5d5b57348c66f0cfdd7d51d6071ee7vboxsync *
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync * VirtualBox COM class implementation
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync */
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
f001425d2b0a661d4cd1f7ea07b4e7454538c829vboxsync/*
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync * Copyright (C) 2008 Sun Microsystems, Inc.
fcae7923a3c756b333f1e33eba002edf4448fb54vboxsync *
fcae7923a3c756b333f1e33eba002edf4448fb54vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
fcae7923a3c756b333f1e33eba002edf4448fb54vboxsync * available from http://www.virtualbox.org. This file is free software;
fcae7923a3c756b333f1e33eba002edf4448fb54vboxsync * you can redistribute it and/or modify it under the terms of the GNU
fcae7923a3c756b333f1e33eba002edf4448fb54vboxsync * General Public License (GPL) as published by the Free Software
fcae7923a3c756b333f1e33eba002edf4448fb54vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
fcae7923a3c756b333f1e33eba002edf4448fb54vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
f001425d2b0a661d4cd1f7ea07b4e7454538c829vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
f001425d2b0a661d4cd1f7ea07b4e7454538c829vboxsync *
f001425d2b0a661d4cd1f7ea07b4e7454538c829vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
f001425d2b0a661d4cd1f7ea07b4e7454538c829vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
f001425d2b0a661d4cd1f7ea07b4e7454538c829vboxsync * additional information or have any questions.
f001425d2b0a661d4cd1f7ea07b4e7454538c829vboxsync */
f001425d2b0a661d4cd1f7ea07b4e7454538c829vboxsync
f001425d2b0a661d4cd1f7ea07b4e7454538c829vboxsync#ifndef ____H_MEDIUMIMPL
f001425d2b0a661d4cd1f7ea07b4e7454538c829vboxsync#define ____H_MEDIUMIMPL
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync#include "VirtualBoxBase.h"
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync#include <VBox/com/SupportErrorInfo.h>
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync#include <list>
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync#include <algorithm>
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsyncclass VirtualBox;
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync////////////////////////////////////////////////////////////////////////////////
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync/**
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync * Base component class for all media types.
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync *
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync * Provides the basic implementation of the IMedium interface.
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync *
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync * @note Subclasses must initialize the mVirtualBox data member in their init()
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync * implementations with the valid VirtualBox instance because some
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync * MediaBase methods call its methods.
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync */
1403063c7e0c0a072d59e323b66068b06278fb9avboxsyncclass ATL_NO_VTABLE MediumBase :
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync virtual public VirtualBoxBaseProto,
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync public com::SupportErrorInfoBase,
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync public VirtualBoxSupportTranslation<MediumBase>,
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync VBOX_SCRIPTABLE_IMPL(IMedium)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync{
1403063c7e0c0a072d59e323b66068b06278fb9avboxsyncpublic:
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (MediumBase)
691076bd437d5cd23673a24c5ba7d4cd77127354vboxsync
691076bd437d5cd23673a24c5ba7d4cd77127354vboxsync DECLARE_EMPTY_CTOR_DTOR (MediumBase)
691076bd437d5cd23673a24c5ba7d4cd77127354vboxsync
691076bd437d5cd23673a24c5ba7d4cd77127354vboxsync /** Describes how a machine refers to this image. */
691076bd437d5cd23673a24c5ba7d4cd77127354vboxsync struct BackRef
691076bd437d5cd23673a24c5ba7d4cd77127354vboxsync {
691076bd437d5cd23673a24c5ba7d4cd77127354vboxsync /** Equality predicate for stdc++. */
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync struct EqualsTo : public std::unary_function <BackRef, bool>
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync {
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync explicit EqualsTo (const Guid &aMachineId) : machineId (aMachineId) {}
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync bool operator() (const argument_type &aThat) const
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync {
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync return aThat.machineId == machineId;
561b8d2b46fb10887829b7e4d7d29447817adbddvboxsync }
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
f65dabff4474710524235022d328b737f174fc1dvboxsync const Guid machineId;
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync };
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync typedef std::list <Guid> GuidList;
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync BackRef() : inCurState (false) {}
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync BackRef (const Guid &aMachineId, const Guid &aSnapshotId = Guid::Empty)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync : machineId (aMachineId)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync , inCurState (aSnapshotId.isEmpty())
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync {
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync if (!aSnapshotId.isEmpty())
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync snapshotIds.push_back (aSnapshotId);
561b8d2b46fb10887829b7e4d7d29447817adbddvboxsync }
fb4eaa62a6bbeb82a89703d833d39339783feb4avboxsync
fb4eaa62a6bbeb82a89703d833d39339783feb4avboxsync Guid machineId;
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync bool inCurState : 1;
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync GuidList snapshotIds;
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync };
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync typedef std::list <BackRef> BackRefList;
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
6479169ec893c18a646cec595e4e214492d180f0vboxsync // IMedium properties
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync STDMETHOD(COMGETTER(Id)) (BSTR *aId);
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync STDMETHOD(COMGETTER(Description)) (BSTR *aDescription);
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync STDMETHOD(COMSETTER(Description)) (IN_BSTR aDescription);
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync STDMETHOD(COMGETTER(State)) (MediaState_T *aState);
a2907076474e923411cc5046492a88787ba377fevboxsync STDMETHOD(COMGETTER(Location)) (BSTR *aLocation);
a2907076474e923411cc5046492a88787ba377fevboxsync STDMETHOD(COMSETTER(Location)) (IN_BSTR aLocation);
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync STDMETHOD(COMGETTER(Name)) (BSTR *aName);
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync STDMETHOD(COMGETTER(Size)) (ULONG64 *aSize);
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync STDMETHOD(COMGETTER(LastAccessError)) (BSTR *aLastAccessError);
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync STDMETHOD(COMGETTER(MachineIds)) (ComSafeArrayOut (BSTR, aMachineIds));
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync // IMedium methods
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync STDMETHOD(GetSnapshotIds) (IN_BSTR aMachineId,
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync ComSafeArrayOut (BSTR, aSnapshotIds));
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync STDMETHOD(LockRead) (MediaState_T *aState);
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync STDMETHOD(UnlockRead) (MediaState_T *aState);
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync STDMETHOD(LockWrite) (MediaState_T *aState);
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync STDMETHOD(UnlockWrite) (MediaState_T *aState);
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync STDMETHOD(Close)();
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync // public methods for internal purposes only
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync HRESULT updatePath (const char *aOldPath, const char *aNewPath);
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync HRESULT attachTo (const Guid &aMachineId,
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync const Guid &aSnapshotId = Guid::Empty);
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync HRESULT detachFrom (const Guid &aMachineId,
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync const Guid &aSnapshotId = Guid::Empty);
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync // unsafe inline public methods for internal purposes only (ensure there is
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync // a caller and a read lock before calling them!)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync const Guid &id() const { return m.id; }
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync MediaState_T state() const { return m.state; }
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync const Bstr &location() const { return m.location; }
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync const Bstr &locationFull() const { return m.locationFull; }
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync const BackRefList &backRefs() const { return m.backRefs; }
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync bool isAttachedTo (const Guid &aMachineId)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync {
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync BackRefList::iterator it =
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync std::find_if (m.backRefs.begin(), m.backRefs.end(),
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync BackRef::EqualsTo (aMachineId));
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync return it != m.backRefs.end() && it->inCurState;
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync }
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsyncprotected:
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync virtual Utf8Str name();
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync virtual HRESULT setLocation (CBSTR aLocation);
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync virtual HRESULT queryInfo();
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync /**
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync * Performs extra checks if the medium can be closed and returns S_OK in
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync * this case. Otherwise, returns a respective error message. Called by
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync * Close() from within this object's AutoMayUninitSpan and from under
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync * mVirtualBox write lock.
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync */
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync virtual HRESULT canClose() { return S_OK; }
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync /**
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync * Performs extra checks if the medium can be attached to the specified
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync * VM and shapshot at the given time and returns S_OK in this case.
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync * Otherwise, returns a respective error message. Called by attachTo() from
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync * within this object's AutoWriteLock.
f48c3167a0f99da174686b66dc4e666f38ecae46vboxsync */
f48c3167a0f99da174686b66dc4e666f38ecae46vboxsync virtual HRESULT canAttach (const Guid & /* aMachineId */,
f48c3167a0f99da174686b66dc4e666f38ecae46vboxsync const Guid & /* aSnapshotId */)
f48c3167a0f99da174686b66dc4e666f38ecae46vboxsync { return S_OK; }
f48c3167a0f99da174686b66dc4e666f38ecae46vboxsync
f48c3167a0f99da174686b66dc4e666f38ecae46vboxsync /**
f48c3167a0f99da174686b66dc4e666f38ecae46vboxsync * Unregisters this medium with mVirtualBox. Called by Close() from within
f48c3167a0f99da174686b66dc4e666f38ecae46vboxsync * this object's AutoMayUninitSpan and from under mVirtualBox write lock.
f48c3167a0f99da174686b66dc4e666f38ecae46vboxsync */
f48c3167a0f99da174686b66dc4e666f38ecae46vboxsync virtual HRESULT unregisterWithVirtualBox() = 0;
f48c3167a0f99da174686b66dc4e666f38ecae46vboxsync
f48c3167a0f99da174686b66dc4e666f38ecae46vboxsync HRESULT setStateError();
f48c3167a0f99da174686b66dc4e666f38ecae46vboxsync
6479169ec893c18a646cec595e4e214492d180f0vboxsync /** weak VirtualBox parent */
6479169ec893c18a646cec595e4e214492d180f0vboxsync const ComObjPtr <VirtualBox, ComWeakRef> mVirtualBox;
6479169ec893c18a646cec595e4e214492d180f0vboxsync
6479169ec893c18a646cec595e4e214492d180f0vboxsync struct Data
6479169ec893c18a646cec595e4e214492d180f0vboxsync {
6479169ec893c18a646cec595e4e214492d180f0vboxsync Data() : state (MediaState_NotCreated), size (0), readers (0)
f48c3167a0f99da174686b66dc4e666f38ecae46vboxsync , queryInfoSem (NIL_RTSEMEVENTMULTI)
f48c3167a0f99da174686b66dc4e666f38ecae46vboxsync , queryInfoCallers (0), accessibleInLock (false) {}
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync const Guid id;
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync Bstr description;
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync MediaState_T state;
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync Bstr location;
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync Bstr locationFull;
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync uint64_t size;
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync Bstr lastAccessError;
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync BackRefList backRefs;
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync size_t readers;
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync RTSEMEVENTMULTI queryInfoSem;
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync size_t queryInfoCallers;
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync bool accessibleInLock : 1;
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync };
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync Data m;
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync};
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync////////////////////////////////////////////////////////////////////////////////
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync/**
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync * Base component class for simple image file based media such as CD/DVD ISO
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync * images or Floppy images.
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync *
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync * Adds specific protectedInit() and saveSettings() methods that can load image
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync * data from the settings files.
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync */
1403063c7e0c0a072d59e323b66068b06278fb9avboxsyncclass ATL_NO_VTABLE ImageMediumBase
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync : public MediumBase
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync , public VirtualBoxBase
a2907076474e923411cc5046492a88787ba377fevboxsync{
a2907076474e923411cc5046492a88787ba377fevboxsyncpublic:
a2907076474e923411cc5046492a88787ba377fevboxsync
a2907076474e923411cc5046492a88787ba377fevboxsync HRESULT FinalConstruct() { return S_OK; }
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync void FinalRelease() { uninit(); }
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsyncprotected:
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync // protected initializer/uninitializer for internal purposes only
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync HRESULT protectedInit (VirtualBox *aVirtualBox, CBSTR aLocation,
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync const Guid &aId);
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync HRESULT protectedInit (VirtualBox *aVirtualBox, const settings::Key &aImageNode);
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync void protectedUninit();
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsyncpublic:
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync // public methods for internal purposes only
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync HRESULT saveSettings (settings::Key &aImagesNode);
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync};
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync////////////////////////////////////////////////////////////////////////////////
6479169ec893c18a646cec595e4e214492d180f0vboxsync
6479169ec893c18a646cec595e4e214492d180f0vboxsync/**
6479169ec893c18a646cec595e4e214492d180f0vboxsync * The DVDImage component class implements the IDVDImage interface.
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync */
1403063c7e0c0a072d59e323b66068b06278fb9avboxsyncclass ATL_NO_VTABLE DVDImage
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync : public com::SupportErrorInfoDerived<ImageMediumBase, DVDImage, IDVDImage>
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync , public VirtualBoxSupportTranslation<DVDImage>
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync , VBOX_SCRIPTABLE_IMPL(IDVDImage)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync{
1403063c7e0c0a072d59e323b66068b06278fb9avboxsyncpublic:
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync COM_FORWARD_IMedium_TO_BASE (ImageMediumBase)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync VIRTUALBOXSUPPORTTRANSLATION_OVERRIDE (DVDImage)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync DECLARE_NOT_AGGREGATABLE (DVDImage)
ed39b7c986cc98221f3f2253f417f79f0f02c942vboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync DECLARE_PROTECT_FINAL_CONSTRUCT()
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync BEGIN_COM_MAP (DVDImage)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync COM_INTERFACE_ENTRY (ISupportErrorInfo)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync COM_INTERFACE_ENTRY2 (IMedium, ImageMediumBase)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync COM_INTERFACE_ENTRY (IDVDImage)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync COM_INTERFACE_ENTRY2 (IDispatch, IDVDImage)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync END_COM_MAP()
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync NS_DECL_ISUPPORTS
f48c3167a0f99da174686b66dc4e666f38ecae46vboxsync
6479169ec893c18a646cec595e4e214492d180f0vboxsync DECLARE_EMPTY_CTOR_DTOR (DVDImage)
6479169ec893c18a646cec595e4e214492d180f0vboxsync
6479169ec893c18a646cec595e4e214492d180f0vboxsync // public initializer/uninitializer for internal purposes only
6479169ec893c18a646cec595e4e214492d180f0vboxsync
6479169ec893c18a646cec595e4e214492d180f0vboxsync HRESULT init (VirtualBox *aParent, CBSTR aFilePath,
6479169ec893c18a646cec595e4e214492d180f0vboxsync const Guid &aId)
6479169ec893c18a646cec595e4e214492d180f0vboxsync {
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync return protectedInit (aParent, aFilePath, aId);
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync }
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync HRESULT init (VirtualBox *aParent, const settings::Key &aImageNode)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync {
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync return protectedInit (aParent, aImageNode);
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync }
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync void uninit() { protectedUninit(); }
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync /** For com::SupportErrorInfoImpl. */
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync static const char *ComponentName() { return "DVDImage"; }
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsyncprivate:
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync HRESULT unregisterWithVirtualBox();
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync};
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync////////////////////////////////////////////////////////////////////////////////
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync/**
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync * The FloppyImage component class implements the IFloppyImage interface.
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync */
1403063c7e0c0a072d59e323b66068b06278fb9avboxsyncclass ATL_NO_VTABLE FloppyImage
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync : public com::SupportErrorInfoDerived<ImageMediumBase, FloppyImage, IFloppyImage>
35473cad6d5d5b57348c66f0cfdd7d51d6071ee7vboxsync , public VirtualBoxSupportTranslation<FloppyImage>
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync , VBOX_SCRIPTABLE_IMPL(IFloppyImage)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync{
1403063c7e0c0a072d59e323b66068b06278fb9avboxsyncpublic:
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync COM_FORWARD_IMedium_TO_BASE (ImageMediumBase)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync VIRTUALBOXSUPPORTTRANSLATION_OVERRIDE (FloppyImage)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync DECLARE_NOT_AGGREGATABLE (FloppyImage)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync DECLARE_PROTECT_FINAL_CONSTRUCT()
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
f48c3167a0f99da174686b66dc4e666f38ecae46vboxsync BEGIN_COM_MAP (FloppyImage)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync COM_INTERFACE_ENTRY (ISupportErrorInfo)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync COM_INTERFACE_ENTRY2 (IMedium, ImageMediumBase)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync COM_INTERFACE_ENTRY (IFloppyImage)
f48c3167a0f99da174686b66dc4e666f38ecae46vboxsync COM_INTERFACE_ENTRY2 (IDispatch, IFloppyImage)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync END_COM_MAP()
16e6d031ca3d1ed4d88ae56fb94d9ad6e4d89c6bvboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync NS_DECL_ISUPPORTS
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync DECLARE_EMPTY_CTOR_DTOR (FloppyImage)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync // public initializer/uninitializer for internal purposes only
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync HRESULT init (VirtualBox *aParent, CBSTR aFilePath,
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync const Guid &aId)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync {
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync return protectedInit (aParent, aFilePath, aId);
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync }
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync HRESULT init (VirtualBox *aParent, const settings::Key &aImageNode)
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync {
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync return protectedInit (aParent, aImageNode);
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync }
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync void uninit() { protectedUninit(); }
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync /** For com::SupportErrorInfoImpl. */
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync static const char *ComponentName() { return "FloppyImage"; }
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsyncprivate:
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync HRESULT unregisterWithVirtualBox();
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync};
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync#endif /* ____H_MEDIUMIMPL */
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync
1403063c7e0c0a072d59e323b66068b06278fb9avboxsync/* vi: set tabstop=4 shiftwidth=4 expandtab: */
2084a447d1acb619df7c393fac41b79d517e4b3dvboxsync