MediumImpl.h revision 8df92cd42f53d6dd8629f2a791c669caeb24ea3a
/* $Id$ */
/** @file
*
* VirtualBox COM class implementation
*/
/*
* Copyright (C) 2008-2012 Oracle Corporation
*
* 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.
*/
#ifndef ____H_MEDIUMIMPL
#define ____H_MEDIUMIMPL
#include "VirtualBoxBase.h"
#include "MediumLock.h"
{
struct Medium;
}
////////////////////////////////////////////////////////////////////////////////
/**
* Medium component class for all media types.
*/
{
void FinalRelease();
// 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 to create empty medium (VirtualBox::CreateHardDisk())
const Guid &uuidMachineRegistry);
// initializer for opening existing media
// (VirtualBox::OpenMedium(); Machine::AttachDevice())
bool fForceNewUuid,
// initializer used when loading settings
const Guid &uuidMachineRegistry,
const Utf8Str &strMachineFolder);
void uninit();
void deparent();
// IMedium properties
// IMedium methods
// unsafe methods for internal purposes only (ensure there is
// a caller and a read lock before calling them!)
const MediaList& getChildren() const;
MediumState_T getState() const;
MediumVariant_T getVariant() const;
bool isHostDrive() const;
const Utf8Str& getLocationFull() const;
bool isMediumFormatFile() const;
DeviceType_T getDeviceType() const;
MediumType_T getType() const;
void markRegistriesModified();
const Guid* getFirstMachineBackrefId() const;
const Guid* getAnyMachineBackref() const;
const Guid* getFirstMachineBackrefSnapshotId() const;
size_t getMachineBackRefCount() const;
#ifdef DEBUG
void dumpBackRefs();
#endif
bool isReadOnly();
const Utf8Str &strHardDiskFolder);
bool fMediumLockWrite,
bool aWait);
const Guid *aMachineId,
const Guid *aSnapshotId,
bool fLockMedia,
bool &fMergeForward,
bool fMergeForward,
const MediaList &aChildrenToReparent,
bool aWait);
const char *pszzValid);
static DECLCALLBACK(int) vdTcpRead(VDSOCKET Sock, void *pvBuffer, size_t cbBuffer, size_t *pcbRead);
struct Data; // opaque data struct, defined in MediumImpl.cpp
Data *m;
};
#endif /* ____H_MEDIUMIMPL */