MediumImpl.h revision 472b4aa13c14be86544ea9d10b9ab21384e09150
/* $Id$ */
/** @file
*
* VirtualBox COM class implementation
*/
/*
* Copyright (C) 2008-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_MEDIUMIMPL
#define ____H_MEDIUMIMPL
#include "VirtualBoxBase.h"
struct VM;
{
struct Medium;
}
////////////////////////////////////////////////////////////////////////////////
/**
* Medium component class for all media types.
*/
{
// have to use a special enum for the overloaded init() below;
// can't use AccessMode_T from XIDL because that's mapped to an int
// and would be ambiguous
// public initializer/uninitializer for internal purposes only
// initializer used when loading settings
void uninit();
// IMedium properties
// IMedium methods
// public methods for internal purposes only
void FinalRelease();
MediumState_T state() const;
const Bstr& locationFull() const;
// const BackRefList& backRefs() const;
const Guid* getFirstMachineBackrefId() const;
const Guid* getFirstMachineBackrefSnapshotId() const;
/**
* Shortcut to VirtualBoxBaseWithTypedChildrenNEXT::dependentChildren().
*/
bool isReadOnly();
/**
* Shortcut to #deleteStorage() that doesn't wait for operation completion
* and implies the progress object will be used for waiting.
*/
/**
* Shortcut to #deleteStorage() that wait for operation completion by
* blocking the current thread.
*/
/**
* Shortcut to #createDiffStorage() that doesn't wait for operation
* completion and implies the progress object will be used for waiting.
*/
/**
* Shortcut to #createDiffStorage() that wait for operation completion by
* blocking the current thread.
*/
bool aIgnoreAttachments = false);
/**
* Shortcut to #mergeTo() that doesn't wait for operation completion and
* implies the progress object will be used for waiting.
*/
/**
* Shortcut to #mergeTo() that wait for operation completion by
* blocking the current thread.
*/
/** Returns a preferred format for a differencing hard disk. */
// unsafe inline public methods for internal purposes only (ensure there is
// a caller and a read lock before calling them!)
MediumType_T type() const;
/** For com::SupportErrorInfoImpl. */
static const char *ComponentName() { return "Medium"; }
// protected initializer/uninitializer for internal purposes only
void protectedUninit();
/**
* Performs extra checks if the medium can be closed and returns S_OK in
* this case. Otherwise, returns a respective error message. Called by
* Close() from within this object's AutoMayUninitSpan and from under
* mVirtualBox write lock.
*/
/**
* Performs extra checks if the medium can be attached to the specified
* VM and shapshot at the given time and returns S_OK in this case.
* Otherwise, returns a respective error message. Called by attachTo() from
* within this object's AutoWriteLock.
*/
const Guid & /* aSnapshotId */);
/**
* Unregisters this medium with mVirtualBox. Called by Close() from within
* this object's AutoMayUninitSpan and from under mVirtualBox write lock.
*/
/** weak VirtualBox parent */
bool aWait);
bool aWait);
RWLockHandle* treeLock();
/** Reimplements VirtualBoxWithTypedChildren::childrenLock() to return
* treeLock(). */
void *pvUser);
const char *pszzValid);
/** weak parent */
struct Task;
struct Data; // opaque data struct, defined in MediumImpl.cpp
Data *m;
};
#endif /* ____H_MEDIUMIMPL */