Logo Search packages:      
Sourcecode: virtualbox-ose version File versions

SnapshotMachine Class Reference

#include <MachineImpl.h>

Inheritance diagram for SnapshotMachine:

VirtualBoxSupportTranslation< SnapshotMachine > VirtualBoxSupportTranslationBase VirtualBoxBaseWithChildrenNEXT VirtualBoxSupportErrorInfoImpl< Machine, IMachine > VirtualBoxSupportTranslation< Machine > VirtualBoxBaseNEXT VirtualBoxSupportErrorInfoImplBase VirtualBoxSupportTranslationBase VirtualBoxBase VirtualBoxBaseProto util::Lockable

List of all members.

Detailed Description

Notes on locking objects of this class: SnapshotMachine shares some data with the primary Machine instance (pointed to by the |mPeer| member). In order to provide data consistency it also shares its lock handle. This means that whenever you lock a SessionMachine instance using Auto[Reader]Lock or AutoMultiLock, the corresponding Machine instance is also locked in the same lock mode. Keep it in mind.

Definition at line 1007 of file MachineImpl.h.

Public Types

typedef AutoStateDependency
< AnyStateDep > 
typedef AutoCallerBase< false > AutoCaller
typedef AutoCallerBase< true > AutoLimitedCaller
typedef AutoStateDependency
< MutableOrSavedStateDep > 
typedef AutoStateDependency
< MutableStateDep > 
enum  InitMode { Init_New, Init_Existing, Init_Registered }
enum  InstanceType { IsMachine, IsSessionMachine, IsSnapshotMachine }
enum  State {
  NotReady, Ready, InInit, InUninit,
  InitFailed, Limited, MayUninit, WillUninit
enum  StateDependency { AnyStateDep = 0, MutableStateDep, MutableOrSavedStateDep }

Public Member Functions

virtual HRESULT addCaller (State *aState=NULL, bool aLimited=false)
template<class C>
void addDependentChild (const ComObjPtr< C > &aChild)
template<class C>
void addDependentChild (C *aChild)
HRESULT addLimitedCaller (State *aState=NULL)
HRESULT addStateDependency (StateDependency aDepType=AnyStateDep, MachineState_T *aState=NULL, BOOL *aRegistered=NULL)
STDMETHOD() AttachHardDisk2 (IN_GUID aId, StorageBus_T aBus, LONG aChannel, LONG aDevice)
int calculateFullPath (const char *aPath, Utf8Str &aResult)
void calculateRelativePath (const char *aPath, Utf8Str &aResult)
STDMETHOD() CanShowConsoleWindow (BOOL *aCanShow)
bool checkForSpawnFailure ()
virtual RWLockHandlechildrenLock ()
STDMETHOD() CreateSharedFolder (IN_BSTR aName, IN_BSTR aHostPath, BOOL aWritable)
STDMETHOD() DeleteSettings ()
STDMETHOD() DetachHardDisk2 (StorageBus_T aBus, LONG aChannel, LONG aDevice)
STDMETHOD() DiscardSettings ()
STDMETHOD() EnumerateGuestProperties (IN_BSTR aPattern, ComSafeArrayOut(BSTR, aNames), ComSafeArrayOut(BSTR, aValues), ComSafeArrayOut(ULONG64, aTimestamps), ComSafeArrayOut(BSTR, aFlags))
void FinalRelease ()
STDMETHOD() FindSnapshot (IN_BSTR aName, ISnapshot **aSnapshot)
STDMETHOD() GetBootOrder (ULONG aPosition, DeviceType_T *aDevice)
STDMETHOD() GetExtraData (IN_BSTR aKey, BSTR *aValue)
STDMETHOD() GetGuestProperty (IN_BSTR aName, BSTR *aValue, ULONG64 *aTimestamp, BSTR *aFlags)
STDMETHOD() GetGuestPropertyTimestamp (IN_BSTR aName, ULONG64 *aTimestamp)
STDMETHOD() GetGuestPropertyValue (IN_BSTR aName, BSTR *aValue)
STDMETHOD() GetHardDisk2 (StorageBus_T aBus, LONG aChannel, LONG aDevice, IHardDisk2 **aHardDisk)
void getLogFolder (Utf8Str &aLogFolder)
STDMETHOD() GetNetworkAdapter (ULONG slot, INetworkAdapter **adapter)
STDMETHOD() GetNextExtraDataKey (IN_BSTR aKey, BSTR *aNextKey, BSTR *aNextValue)
STDMETHOD() GetParallelPort (ULONG slot, IParallelPort **port)
STDMETHOD() GetSerialPort (ULONG slot, ISerialPort **port)
HRESULT getSharedFolder (CBSTR aName, ComObjPtr< SharedFolder > &aSharedFolder, bool aSetError=false)
STDMETHOD() GetSnapshot (IN_GUID aId, ISnapshot **aSnapshot)
const Guidid () const
HRESULT init (VirtualBox *aParent, CBSTR aConfigFile, InitMode aMode, CBSTR aName=NULL, GuestOSType *aOsType=NULL, BOOL aNameSync=TRUE, const Guid *aId=NULL)
HRESULT init (Machine *aMachine, const settings::Key &aHWNode, const settings::Key &aHDAsNode, IN_GUID aSnapshotId, IN_BSTR aStateFilePath)
HRESULT init (SessionMachine *aSessionMachine, IN_GUID aSnapshotId, IN_BSTR aStateFilePath)
STDMETHOD() InterfaceSupportsErrorInfo (REFIID riid)
bool isLockedOnCurrentThread ()
bool isRegistered ()
bool isSessionOpen (ComObjPtr< SessionMachine > &aMachine, ComPtr< IInternalSessionControl > *aControl=NULL, bool aAllowClosing=false)
bool isSessionOpenOrClosing (ComObjPtr< SessionMachine > &aMachine, ComPtr< IInternalSessionControl > *aControl=NULL)
bool isSessionSpawning ()
bool isWriteLockOnCurrentThread ()
RWLockHandlelockHandle () const
const Bstrname () const
virtual HRESULT onDVDDriveChange ()
virtual HRESULT onFloppyDriveChange ()
virtual HRESULT onNetworkAdapterChange (INetworkAdapter *networkAdapter)
virtual HRESULT onParallelPortChange (IParallelPort *ParallelPort)
virtual HRESULT onSATAControllerChange ()
virtual HRESULT onSerialPortChange (ISerialPort *serialPort)
virtual HRESULT onSharedFolderChange ()
HRESULT onSnapshotChange (Snapshot *aSnapshot)
virtual HRESULT onUSBControllerChange ()
virtual HRESULT onVRDPServerChange ()
HRESULT openExistingSession (IInternalSessionControl *aControl)
HRESULT openRemoteSession (IInternalSessionControl *aControl, IN_BSTR aType, IN_BSTR aEnvironment, Progress *aProgress)
HRESULT openSession (IInternalSessionControl *aControl)
virtual void releaseCaller ()
void releaseStateDependency ()
template<class C>
void removeDependentChild (const ComObjPtr< C > &aChild)
template<class C>
void removeDependentChild (C *aChild)
STDMETHOD() RemoveSharedFolder (IN_BSTR aName)
LockOps * rlock ()
HRESULT saveRegistryEntry (settings::Key &aEntryNode)
STDMETHOD() SaveSettings ()
STDMETHOD() SaveSettingsWithBackup (BSTR *aBakFileName)
STDMETHOD() SetBootOrder (ULONG aPosition, DeviceType_T aDevice)
STDMETHOD() SetCurrentSnapshot (IN_GUID aId)
STDMETHOD() SetExtraData (IN_BSTR aKey, IN_BSTR aValue)
STDMETHOD() SetGuestProperty (IN_BSTR aName, IN_BSTR aValue, IN_BSTR aFlags)
STDMETHOD() SetGuestPropertyValue (IN_BSTR aName, IN_BSTR aValue)
const BstrsettingsFileFull () const
STDMETHOD() ShowConsoleWindow (ULONG64 *aWinId)
const GuidsnapshotId () const
 STDMETHOD (COMSETTER(GuestPropertyNotificationPatterns))(IN_BSTR aPattern)
 STDMETHOD (COMGETTER(GuestPropertyNotificationPatterns))(BSTR *aPattern)
 STDMETHOD (COMSETTER(ClipboardMode))(ClipboardMode_T aClipboardMode)
 STDMETHOD (COMGETTER(ClipboardMode))(ClipboardMode_T *aClipboardMode)
 STDMETHOD (COMGETTER(SharedFolders))(ISharedFolderCollection **aSharedFolders)
 STDMETHOD (COMGETTER(CurrentStateModified))(BOOL *aCurrentStateModified)
 STDMETHOD (COMGETTER(SnapshotCount))(ULONG *aSnapshotCount)
 STDMETHOD (COMGETTER(CurrentSnapshot))(ISnapshot **aCurrentSnapshot)
 STDMETHOD (COMGETTER(StateFilePath))(BSTR *aStateFilePath)
 STDMETHOD (COMGETTER(LastStateChange))(LONG64 *aLastStateChange)
 STDMETHOD (COMGETTER(State))(MachineState_T *machineState)
 STDMETHOD (COMGETTER(SessionPid))(ULONG *aSessionPid)
 STDMETHOD (COMGETTER(SessionType))(BSTR *aSessionType)
 STDMETHOD (COMGETTER(SessionState))(SessionState_T *aSessionState)
 STDMETHOD (COMGETTER(SettingsModified))(BOOL *aModified)
 STDMETHOD (COMGETTER(SettingsFileVersion))(BSTR *aSettingsFileVersion)
 STDMETHOD (COMGETTER(SettingsFilePath))(BSTR *aFilePath)
 STDMETHOD (COMGETTER(SATAController))(ISATAController **aSATAController)
 STDMETHOD (COMGETTER(USBController))(IUSBController **aUSBController)
 STDMETHOD (COMGETTER(AudioAdapter))(IAudioAdapter **audioAdapter)
 STDMETHOD (COMGETTER(FloppyDrive))(IFloppyDrive **floppyDrive)
 STDMETHOD (COMGETTER(VRDPServer))(IVRDPServer **vrdpServer)
 STDMETHOD (COMGETTER(HardDisk2Attachments))(ComSafeArrayOut(IHardDisk2Attachment *
 STDMETHOD (COMSETTER(SnapshotFolder))(IN_BSTR aSavedStateFolder)
 STDMETHOD (COMGETTER(SnapshotFolder))(BSTR *aSavedStateFolder)
 STDMETHOD (COMSETTER(HWVirtExNestedPagingEnabled))(BOOL enabled)
 STDMETHOD (COMGETTER(HWVirtExNestedPagingEnabled))(BOOL *enabled)
 STDMETHOD (COMSETTER(HWVirtExEnabled))(TSBool_T enabled)
 STDMETHOD (COMGETTER(HWVirtExEnabled))(TSBool_T *enabled)
 STDMETHOD (COMGETTER(BIOSSettings))(IBIOSSettings **biosSettings)
 STDMETHOD (COMSETTER(Accelerate3DEnabled))(BOOL enabled)
 STDMETHOD (COMGETTER(Accelerate3DEnabled))(BOOL *enabled)
 STDMETHOD (COMSETTER(MonitorCount))(ULONG monitorCount)
 STDMETHOD (COMGETTER(MonitorCount))(ULONG *monitorCount)
 STDMETHOD (COMSETTER(StatisticsUpdateInterval))(ULONG statisticsUpdateInterval)
 STDMETHOD (COMGETTER(StatisticsUpdateInterval))(ULONG *statisticsUpdateInterval)
 STDMETHOD (COMSETTER(MemoryBalloonSize))(ULONG memoryBalloonSize)
 STDMETHOD (COMGETTER(MemoryBalloonSize))(ULONG *memoryBalloonSize)
 STDMETHOD (COMSETTER(MemorySize))(ULONG memorySize)
 STDMETHOD (COMGETTER(MemorySize))(ULONG *memorySize)
 STDMETHOD (COMSETTER(HardwareVersion))(IN_BSTR aVersion)
 STDMETHOD (COMGETTER(HardwareVersion))(BSTR *aVersion)
 STDMETHOD (COMSETTER(Description))(IN_BSTR aDescription)
 STDMETHOD (COMGETTER(Description))(BSTR *aDescription)
 STDMETHOD (COMGETTER(AccessError))(IVirtualBoxErrorInfo **aAccessError)
 STDMETHOD (COMGETTER(Accessible))(BOOL *aAccessible)
 STDMETHOD (COMGETTER(Parent))(IVirtualBox **aParent)
HRESULT trySetRegistered (BOOL aRegistered)
InstanceType type () const
void uninit ()
const ComObjPtr< VirtualBox,
ComWeakRef > & 
virtualBox () const
LockOps * wlock ()

Static Public Member Functions

static const wchar_t * getComponentName ()
static const char * tr (const char *aSourceText, const char *aComment=NULL)
static const char * tr (const char *aSourceText, const char *aComment=NULL)
static const char * translate (const char *context, const char *sourceText, const char *comment=0)
static const char * translate (const char *context, const char *sourceText, const char *comment=0)

Public Attributes


Protected Types

enum  {
  SaveS_ResetCurStateModified = 0x01, SaveS_InformCallbacksAnyway = 0x02, SaveSS_NoOp = 0x00, SaveSS_AddOp = 0x01,
  SaveSS_UpdateAttrsOp = 0x02, SaveSS_UpdateAllOp = 0x03, SaveSS_OpMask = 0xF, SaveSS_CurStateModified = 0x40,
  SaveSS_CurrentId = 0x80, SaveSTS_CurStateModified = 0x20, SaveSTS_StateFilePath = 0x40, SaveSTS_StateTimeStamp = 0x80

Protected Member Functions

HRESULT checkStateDependency (StateDependency aDepType)
void commit ()
void copyFrom (Machine *aThat)
HRESULT createImplicitDiffs (const Bstr &aFolder, ComObjPtr< Progress > &aProgress, bool aOnline)
HRESULT deleteImplicitDiffs ()
void ensureNoStateDependencies ()
HRESULT findSharedFolder (CBSTR aName, ComObjPtr< SharedFolder > &aSharedFolder, bool aSetError=false)
HRESULT findSnapshot (IN_BSTR aName, ComObjPtr< Snapshot > &aSnapshot, bool aSetError=false)
HRESULT findSnapshot (const Guid &aId, ComObjPtr< Snapshot > &aSnapshot, bool aSetError=false)
HRESULT findSnapshotNode (Snapshot *aSnapshot, settings::Key &aMachineNode, settings::Key *aSnapshotsNode, settings::Key *aSnapshotNode)
void fixupHardDisks2 (bool aCommit, bool aOnline=false)
VirtualBoxBaseNEXTgetDependentChild (const ComPtr< IUnknown > &aUnk)
HRESULT initDataAndChildObjects ()
BOOL isConfigLocked ()
bool isInOwnDir (Utf8Str *aSettingsDir=NULL)
bool isModified ()
bool isReallyModified (bool aIgnoreUserData=false)
HRESULT loadHardDisks (const settings::Key &aNode, bool aRegistered, const Guid *aSnapshotId=NULL)
HRESULT loadHardware (const settings::Key &aNode)
HRESULT loadSettings (bool aRegistered)
HRESULT loadSnapshot (const settings::Key &aNode, const Guid &aCurSnapshotId, Snapshot *aParentSnapshot)
HRESULT lockConfig ()
Machine * machine ()
HRESULT prepareSaveSettings (bool &aRenamed, bool &aNew)
HRESULT registeredInit ()
void rollback (bool aNotify)
HRESULT saveHardDisks (settings::Key &aNode)
HRESULT saveHardware (settings::Key &aNode)
HRESULT saveSettings (int aFlags=0)
HRESULT saveSnapshot (settings::Key &aNode, Snapshot *aSnapshot, bool aAttrsOnly)
HRESULT saveSnapshotSettings (Snapshot *aSnapshot, int aOpFlags)
HRESULT saveSnapshotSettingsWorker (settings::Key &aMachineNode, Snapshot *aSnapshot, int aOpFlags)
HRESULT saveStateSettings (int aFlags)
virtual HRESULT setMachineState (MachineState_T aMachineState)
WriteLockHandlestateLockHandle ()
void uninitDataAndChildObjects ()
void uninitDependentChildren ()
HRESULT unlockConfig ()

Static Protected Member Functions

static const char * className ()
static const char * className ()
static bool cutClassNameFrom__PRETTY_FUNCTION__ (char *aPrettyFunctionName)
static HRESULT setError (HRESULT aResultCode, const GUID &aIID, const Bstr &aComponent, const char *aText, va_list aArgs, bool aLogIt=true)
static HRESULT setError (HRESULT aResultCode, const GUID &aIID, const Bstr &aComponent, const Bstr &aText, bool aLogIt=true)
static HRESULT setError (HRESULT aResultCode, const GUID &aIID, const char *aText,...)
static HRESULT setError (HRESULT aResultCode, const char *aText,...)
static HRESULT setError (HRESULT aResultCode, const GUID &aIID, const wchar_t *aComponent, const char *aText,...)
static HRESULT setErrorBstr (HRESULT aResultCode, const Bstr &aText)
static HRESULT setErrorNoLog (HRESULT aResultCode, const char *aText,...)
static HRESULT setErrorV (HRESULT aResultCode, const char *aText, va_list aArgs)
static HRESULT setWarning (HRESULT aResultCode, const GUID &aIID, const Bstr &aComponent, const char *aText, va_list aArgs)
static HRESULT setWarning (HRESULT aResultCode, const GUID &aIID, const Bstr &aComponent, const Bstr &aText)
static HRESULT setWarning (HRESULT aResultCode, const GUID &aIID, const char *aText,...)
static HRESULT setWarning (HRESULT aResultCode, const char *aText,...)
static HRESULT setWarning (HRESULT aResultCode, const GUID &aIID, const wchar_t *aComponent, const char *aText,...)
static HRESULT setWarningBstr (HRESULT aResultCode, const Bstr &aText)
static HRESULT setWarningV (HRESULT aResultCode, const char *aText, va_list aArgs)

Protected Attributes

const ComObjPtr< AudioAdapter > mAudioAdapter
const ComObjPtr< BIOSSettings > mBIOSSettings
Shareable< DatamData
const ComObjPtr< DVDDrive > mDVDDrive
const ComObjPtr< FloppyDrive > mFloppyDrive
Backupable< HDDatamHDData
Backupable< HWDatamHWData
const ComObjPtr< NetworkAdapter > mNetworkAdapters [SchemaDefs::NetworkAdapterCount]
const ComObjPtr< ParallelPort > mParallelPorts [SchemaDefs::ParallelPortCount]
const ComObjPtr< VirtualBox,
const ComObjPtr< Machine,
const ComObjPtr< SATAController > mSATAController
const ComObjPtr< SerialPort > mSerialPorts [SchemaDefs::SerialPortCount]
Shareable< SSDatamSSData
const InstanceType mType
const ComObjPtr< USBControllermUSBController
Backupable< UserDatamUserData
const ComObjPtr< VRDPServer > mVRDPServer

Private Attributes

Guid mSnapshotId


class SessionMachine
class Snapshot
class SnapshotMachine

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index