MediumImpl.h revision 0df8f2889273aee65079da0f4b5727a4ac6d3e7b
/* $Id$ */
/** @file
* VirtualBox COM class implementation
*/
/*
* Copyright (C) 2008-2015 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 "MediumWrap.h"
#include "VirtualBoxBase.h"
#include "AutoCaller.h"
#include "SecretKeyStore.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::CreateMedium())
const Guid &uuidMachineRegistry,
const DeviceType_T aDeviceType);
// initializer for opening existing media
// (VirtualBox::OpenMedium(); Machine::AttachDevice())
bool fForceNewUuid,
// initializer used when loading settings
const Guid &uuidMachineRegistry,
const Utf8Str &strMachineFolder);
const Guid &uuidMachineRegistry,
const Utf8Str &strMachineFolder,
void uninit();
void i_deparent();
// unsafe methods for internal purposes only (ensure there is
// a caller and a read lock before calling them!)
const MediaList& i_getChildren() const;
MediumState_T i_getState() const;
MediumVariant_T i_getVariant() const;
bool i_isHostDrive() const;
const Utf8Str& i_getLocationFull() const;
const Utf8Str& i_getFormat() const;
bool i_isMediumFormatFile() const;
DeviceType_T i_getDeviceType() const;
MediumType_T i_getType() const;
void i_markRegistriesModified();
const Guid* i_getFirstMachineBackrefId() const;
const Guid* i_getAnyMachineBackref() const;
const Guid* i_getFirstMachineBackrefSnapshotId() const;
size_t i_getMachineBackRefCount() const;
#ifdef DEBUG
void i_dumpBackRefs();
#endif
bool i_isReadOnly();
const Utf8Str &strHardDiskFolder);
const Utf8Str &strHardDiskFolder);
bool fMediumLockWrite,
bool fMediumLockWriteAll,
bool aWait);
bool &fMergeForward);
const Guid *aMachineId,
const Guid *aSnapshotId,
bool fLockMedia,
bool &fMergeForward,
bool fMergeForward,
bool aWait);
const Utf8Str& i_getKeyId();
// wrapped IMedium properties
// wrapped IMedium methods
// Private internal nmethods
const char *pszzValid);
static DECLCALLBACK(int) i_vdTcpClientConnect(VDSOCKET Sock, const char *pszAddress, uint32_t uPort,
static DECLCALLBACK(int) i_vdTcpRead(VDSOCKET Sock, void *pvBuffer, size_t cbBuffer, size_t *pcbRead);
const char *pszzValid);
static DECLCALLBACK(int) i_vdCryptoKeyStorePasswordRetain(void *pvUser, const char *pszId, const char **ppszPassword);
static DECLCALLBACK(int) i_vdCryptoKeyStoreSave(void *pvUser, const void *pvKeyStore, size_t cbKeyStore);
struct CryptoFilterSettings;
const char *pszKeyStore, const char *pszPassword,
bool fCreateKeyStore);
struct Data; // opaque data struct, defined in MediumImpl.cpp
Data *m;
};
#endif /* ____H_MEDIUMIMPL */