VirtualBox

source: vbox/trunk/src/VBox/Main/include/SnapshotImpl.h@ 83489

Last change on this file since 83489 was 82968, checked in by vboxsync, 5 years ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.3 KB
Line 
1/* $Id: SnapshotImpl.h 82968 2020-02-04 10:35:17Z vboxsync $ */
2/** @file
3 * VirtualBox COM class implementation
4 */
5
6/*
7 * Copyright (C) 2006-2020 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef MAIN_INCLUDED_SnapshotImpl_h
19#define MAIN_INCLUDED_SnapshotImpl_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24#include "SnapshotWrap.h"
25
26class SnapshotMachine;
27
28namespace settings
29{
30 struct Snapshot;
31}
32
33class ATL_NO_VTABLE Snapshot :
34 public SnapshotWrap
35{
36public:
37 DECLARE_EMPTY_CTOR_DTOR(Snapshot)
38
39 HRESULT FinalConstruct();
40 void FinalRelease();
41
42 // public initializer/uninitializer only for internal purposes
43 HRESULT init(VirtualBox *aVirtualBox,
44 const Guid &aId,
45 const com::Utf8Str &aName,
46 const com::Utf8Str &aDescription,
47 const RTTIMESPEC &aTimeStamp,
48 SnapshotMachine *aMachine,
49 Snapshot *aParent);
50 void uninit();
51
52 void i_beginSnapshotDelete();
53
54 void i_deparent();
55
56 // public methods only for internal purposes
57
58 /**
59 * Override of the default locking class to be used for validating lock
60 * order with the standard member lock handle.
61 */
62 virtual VBoxLockingClass getLockingClass() const
63 {
64 return LOCKCLASS_SNAPSHOTOBJECT;
65 }
66
67 const ComObjPtr<Snapshot>& i_getParent() const;
68 const ComObjPtr<Snapshot> i_getFirstChild() const;
69
70 const Utf8Str& i_getStateFilePath() const;
71
72 uint32_t i_getDepth();
73
74 ULONG i_getChildrenCount();
75 ULONG i_getAllChildrenCount();
76 ULONG i_getAllChildrenCountImpl();
77
78 const ComObjPtr<SnapshotMachine>& i_getSnapshotMachine() const;
79
80 Guid i_getId() const;
81 const Utf8Str& i_getName() const;
82 RTTIMESPEC i_getTimeStamp() const;
83
84 ComObjPtr<Snapshot> i_findChildOrSelf(IN_GUID aId);
85 ComObjPtr<Snapshot> i_findChildOrSelf(const com::Utf8Str &aName);
86
87 void i_updateSavedStatePaths(const Utf8Str &strOldPath,
88 const Utf8Str &strNewPath);
89 void i_updateSavedStatePathsImpl(const Utf8Str &strOldPath,
90 const Utf8Str &strNewPath);
91
92 bool i_sharesSavedStateFile(const Utf8Str &strPath,
93 Snapshot *pSnapshotToIgnore);
94
95 void i_updateNVRAMPaths(const Utf8Str &strOldPath,
96 const Utf8Str &strNewPath);
97 void i_updateNVRAMPathsImpl(const Utf8Str &strOldPath,
98 const Utf8Str &strNewPath);
99
100 HRESULT i_saveSnapshot(settings::Snapshot &data) const;
101 HRESULT i_saveSnapshotImpl(settings::Snapshot &data) const;
102 HRESULT i_saveSnapshotImplOne(settings::Snapshot &data) const;
103
104 HRESULT i_uninitOne(AutoWriteLock &writeLock,
105 CleanupMode_T cleanupMode,
106 MediaList &llMedia,
107 std::list<Utf8Str> &llFilenames);
108 HRESULT i_uninitRecursively(AutoWriteLock &writeLock,
109 CleanupMode_T cleanupMode,
110 MediaList &llMedia,
111 std::list<Utf8Str> &llFilenames);
112
113
114private:
115
116 struct Data; // opaque, defined in SnapshotImpl.cpp
117
118 // wrapped ISnapshot properties
119 HRESULT getId(com::Guid &aId);
120 HRESULT getName(com::Utf8Str &aName);
121 HRESULT setName(const com::Utf8Str &aName);
122 HRESULT getDescription(com::Utf8Str &aDescription);
123 HRESULT setDescription(const com::Utf8Str &aDescription);
124 HRESULT getTimeStamp(LONG64 *aTimeStamp);
125 HRESULT getOnline(BOOL *aOnline);
126 HRESULT getMachine(ComPtr<IMachine> &aMachine);
127 HRESULT getParent(ComPtr<ISnapshot> &aParent);
128 HRESULT getChildren(std::vector<ComPtr<ISnapshot> > &aChildren);
129
130 // wrapped ISnapshot methods
131 HRESULT getChildrenCount(ULONG *aChildrenCount);
132
133 Data *m;
134};
135
136#endif /* !MAIN_INCLUDED_SnapshotImpl_h */
137
138/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette