1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
/* $Id: SnapshotImpl.h $ */
/** @file
*
* VirtualBox COM class implementation
*/
/*
* Copyright (C) 2006-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;
* you can redistribute it and/or modify it under the terms of the GNU
* 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_SNAPSHOTIMPL
#define ____H_SNAPSHOTIMPL
#include "VirtualBoxBase.h"
#include <iprt/time.h>
class SnapshotMachine;
namespace settings
{
struct Snapshot;
}
class ATL_NO_VTABLE Snapshot :
public VirtualBoxBase,
VBOX_SCRIPTABLE_IMPL(ISnapshot)
{
public:
VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(Snapshot, ISnapshot)
DECLARE_NOT_AGGREGATABLE(Snapshot)
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(Snapshot)
VBOX_DEFAULT_INTERFACE_ENTRIES (ISnapshot)
END_COM_MAP()
Snapshot()
: m(NULL)
{ };
~Snapshot()
{ };
HRESULT FinalConstruct();
void FinalRelease();
// public initializer/uninitializer only for internal purposes
HRESULT init(VirtualBox *aVirtualBox,
const Guid &aId,
const Utf8Str &aName,
const Utf8Str &aDescription,
const RTTIMESPEC &aTimeStamp,
SnapshotMachine *aMachine,
Snapshot *aParent);
void uninit();
void beginSnapshotDelete();
void deparent();
// ISnapshot properties
STDMETHOD(COMGETTER(Id))(BSTR *aId);
STDMETHOD(COMGETTER(Name))(BSTR *aName);
STDMETHOD(COMSETTER(Name))(IN_BSTR aName);
STDMETHOD(COMGETTER(Description))(BSTR *aDescription);
STDMETHOD(COMSETTER(Description))(IN_BSTR aDescription);
STDMETHOD(COMGETTER(TimeStamp))(LONG64 *aTimeStamp);
STDMETHOD(COMGETTER(Online))(BOOL *aOnline);
STDMETHOD(COMGETTER(Machine))(IMachine **aMachine);
STDMETHOD(COMGETTER(Parent))(ISnapshot **aParent);
STDMETHOD(COMGETTER(Children))(ComSafeArrayOut(ISnapshot *, aChildren));
// ISnapshot methods
STDMETHOD(GetChildrenCount)(ULONG* count);
// public methods only for internal purposes
/**
* Override of the default locking class to be used for validating lock
* order with the standard member lock handle.
*/
virtual VBoxLockingClass getLockingClass() const
{
return LOCKCLASS_SNAPSHOTOBJECT;
}
const ComObjPtr<Snapshot>& getParent() const;
const ComObjPtr<Snapshot> getFirstChild() const;
const Utf8Str& getStateFilePath() const;
uint32_t getDepth();
ULONG getChildrenCount();
ULONG getAllChildrenCount();
ULONG getAllChildrenCountImpl();
const ComObjPtr<SnapshotMachine>& getSnapshotMachine() const;
Guid getId() const;
const Utf8Str& getName() const;
RTTIMESPEC getTimeStamp() const;
ComObjPtr<Snapshot> findChildOrSelf(IN_GUID aId);
ComObjPtr<Snapshot> findChildOrSelf(const Utf8Str &aName);
void updateSavedStatePaths(const Utf8Str &strOldPath,
const Utf8Str &strNewPath);
void updateSavedStatePathsImpl(const Utf8Str &strOldPath,
const Utf8Str &strNewPath);
bool sharesSavedStateFile(const Utf8Str &strPath,
Snapshot *pSnapshotToIgnore);
HRESULT saveSnapshot(settings::Snapshot &data, bool aAttrsOnly);
HRESULT saveSnapshotImpl(settings::Snapshot &data, bool aAttrsOnly);
HRESULT uninitRecursively(AutoWriteLock &writeLock,
CleanupMode_T cleanupMode,
MediaList &llMedia,
std::list<Utf8Str> &llFilenames);
private:
struct Data; // opaque, defined in SnapshotImpl.cpp
Data *m;
};
#endif // ____H_SNAPSHOTIMPL
/* vi: set tabstop=4 shiftwidth=4 expandtab: */
|