MediumAttachmentImpl.h revision 7d489056acc6f4cad1b87b679e8591c3a8418e9a
/** @file
*
* VirtualBox COM class implementation
*/
/*
* Copyright (C) 2006-2009 Sun Microsystems, Inc.
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#ifndef ____H_MEDIUMATTACHMENTIMPL
#define ____H_MEDIUMATTACHMENTIMPL
#include "VirtualBoxBase.h"
#include "MediumImpl.h"
#include "StorageControllerImpl.h"
{
// public initializer/uninitializer for internal purposes only
const Bstr &aControllerName,
bool aImplicit = false);
void uninit();
void FinalRelease();
bool rollback();
void commit();
// IMediumAttachment properties
// unsafe inline public methods for internal purposes only (ensure there is
// a caller and a read lock before calling them!)
bool isImplicit() const { return m->implicit; }
{
return ( aControllerName == m->controllerName
}
/** Must be called from under this object's write lock. */
bool aImplicit,
{
m.backup();
if (m->medium && aMachineId)
}
/** Must be called from under this object's write lock. */
void updatePassthrough(bool aPassthrough)
{
m.backup();
m->passthrough = aPassthrough;
}
/** For com::SupportErrorInfoImpl. */
static const char *ComponentName() { return "MediumAttachment"; }
/** Reference to Machine object, for checking mutable state. */
/* later: const ComObjPtr<MediumAttachment> mPeer; */
struct Data
{
passthrough(false), implicit(false) {}
{
}
/* Since MediumAttachment is not a first class citizen when it
* comes to managing settings, having a reference to the storage
* controller will not work - when settings are changed it will point
* to the old, uninitialized instance. Changing this requires
* substantial changes to MediumImpl.cpp. */
const DeviceType_T type;
bool passthrough : 1;
bool implicit : 1;
};
Backupable<Data> m;
};
#endif // ____H_MEDIUMATTACHMENTIMPL
/* vi: set tabstop=4 shiftwidth=4 expandtab: */