SnapshotImpl.cpp revision f72cbd6a549c34992fa79cce84600fe2b92b3299
* VirtualBox COM class implementation * Copyright (C) 2006-2007 Sun Microsystems, Inc. * This file is part of VirtualBox Open Source Edition (OSE), as * 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. * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa * additional information or have any questions. // constructor / destructor //////////////////////////////////////////////////////////////////////////////// * Initializes the instance * @param aId id of the snapshot * @param aName name of the snapshot * @param aDescription name of the snapshot (NULL if no description) * @param aTimeStamp timestamp of the snapshot, in ms since 1970-01-01 UTC * @param aMachine machine associated with this snapshot * @param aParent parent snapshot (NULL if no parent) * Uninitializes the instance and sets the ready flag to FALSE. * Called either from FinalRelease(), by the parent when it gets destroyed, * or by a third party when it decides this object is no more valid. * Discards the current snapshot by removing it from the tree of snapshots * and reparenting its children. * This method also calls #uninit() in case of success. // detach all our children to avoid their uninit in #uninit() // finalize uninitialization //////////////////////////////////////////////////////////////////////////////// * @note Locks this object for writing, then calls Machine::onSnapshotChange() * (see its lock requirements). alock.
leave();
/* Important! (child->parent locks are forbidden) */ alock.
leave();
/* Important! (child->parent locks are forbidden) */ // public methods only for internal purposes //////////////////////////////////////////////////////////////////////////////// * Must be called from under the object's lock! * Returns the number of children of this snapshot, including grand-children, * Searches for a snapshot with the given ID among children, grand-children, * etc. of this snapshot. This snapshot itself is also included in the search. * Searches for a first snapshot with the given name among children, * grand-children, etc. of this snapshot. This snapshot itself is also included * Checks if the specified path change affects the saved state file path of * this snapshot or any of its (grand-)children and updates it accordingly. * Intended to be called by Machine::openConfigLoader() only. * @param aOldPath old path (full) * @param aNewPath new path (full) * @note Locks this object + children for writing. /* state file may be NULL (for offline snapshots) */ /* vi: set tabstop=4 shiftwidth=4 expandtab: */