#include <DesignHistoryRestore.h>
Public Member Functions | |
void | SetDontForceModelDelete (bool) |
DesignHistoryRestore () | |
Initializes the DesignHistoryRestore object but does not actually do the work. See Restore. More... | |
~DesignHistoryRestore () | |
Release resources used. More... | |
Static Public Member Functions | |
static bool | CanRestore (DesignHistory &dh, RevisionNumbersForFile &revs, ElementChangeRecordFilter const &ssfilter) |
Test if Restore is possible. More... | |
static bool | IsRollback (RevisionNumber &targetRev, DesignHistory &dh, RevisionNumbersForFile &revs, ElementChangeRecordFilter const &ssfilter) |
Test if Restore using the specified parameters would be equivalent to rolling back the state of the file. More... | |
static long | GetUndoPos () |
Used to undo failed attempt to restore. More... | |
Restore history versions | |
StatusInt | Restore (DgnFileR file, RevisionNumber const &targetRev, bool fromUndo=false) |
Restores all elements to specified point in history. More... | |
StatusInt | Restore (DgnFileR file, RevisionNumber const &targetRev, ModelsToElementChangesMap const &elements) |
Restore selected elements to specified point in history. More... | |
StatusInt | Restore (DgnFileR file, RevisionNumber const &targetRev, IElementQueryResultFilter &csfilter, ElementChangeRecordFilter const &ssfilter) |
Restore selected elements to specified point in history. More... | |
static RestoreType | IsRestoreInProgress (DgnFileR file) |
Check if DesignHistoryRestore is currently updating the specified file. More... | |
Initializes the DesignHistoryRestore object but does not actually do the work. See Restore.
~DesignHistoryRestore | ( | ) |
Release resources used.
|
static |
Test if Restore is possible.
Restore is not possible if ssfilter selects only some change types or if revs does not define a contiguous range of revisions.
dh | The history that would be queried |
revs | The revisions to be restored |
ssfilter | The server-side filter that would be used |
|
static |
Used to undo failed attempt to restore.
|
static |
Check if DesignHistoryRestore is currently updating the specified file.
file | IN the file to check |
|
static |
Test if Restore using the specified parameters would be equivalent to rolling back the state of the file.
This is false if ssfilter selects only some change types or if revs does not define a contiguous range of revisions beginning with the tip revision or Recent, if there are recent changes.
[out] | targetRev | On return, this is set to the revision just before the earliest revision in the range. |
[in] | dh | The history that would be queried |
[in] | revs | The revisions to be restored |
[in] | ssfilter | The server-side filter that would be used |
StatusInt Restore | ( | DgnFileR | file, |
RevisionNumber const & | targetRev, | ||
bool | fromUndo = false |
||
) |
Restores all elements to specified point in history.
This is non-selective restore. It does the following:
Handler::RestoreHistoricalVersion is not called.
When a reference file is attached as of a revision, MicroStation uses non-selective restore. Handler::_OnHistoryRestore is called, but handlers can ignore it, since it pertains to elements that are not in the master file.
file | file to modify |
targetRev | point in history to which file should be restored |
fromUndo | true if we are actually restoring only one revision, but it's the latest revision. |
StatusInt Restore | ( | DgnFileR | file, |
RevisionNumber const & | targetRev, | ||
ModelsToElementChangesMap const & | elements | ||
) |
Restore selected elements to specified point in history.
Selective restore does the following:
Design History restore delegates the element restore operation to handlers by calling Handler::RestoreHistoricalVersion. The base class implementation of RestoreHistoricalVersion is to handle updates by first deleting the element and then calling mdlElmdscr_copy (preserving ElementIDs). It then calls Handler::_OnHistoryRestore. A handler can override this method to call subsystem API functions, as appropriate.
ChangeTrack callbacks are also triggered.
In most cases, Design History restore will also invoke Handler::OnHistoryRestore callbacks. Normally, you should implement Handler::OnHistoryRestore to call your Redo hook.
When doing a selective, element-level restore, Design History will attempt to restore complex components individually. While this is normally a bad idea, this gives Table handlers and others a chance to implement RestoreHistoricalVersion to restore components intelligently. The base class implementation ignores components.
Note: For Table elements, it is usually appropriate to override RestoreHistoricalVersion in both the table and the entry handlers. The table handler should ignore the request to restore the header element. The entry handler should patch the table as appropriate to restore the entry.
file | file to modify |
targetRev | point in history to which file should be restored |
elements | the specific elements to restore |
StatusInt Restore | ( | DgnFileR | file, |
RevisionNumber const & | targetRev, | ||
IElementQueryResultFilter & | csfilter, | ||
ElementChangeRecordFilter const & | ssfilter | ||
) |
Restore selected elements to specified point in history.
p> This function uses the supplied filters to identify the elements of interest and then calls selective Restore.
file | file to modify |
targetRev | point in history to which file should be restored |
csfilter | selects which elements to restore (applied on client) |
ssfilter | selects which elements to restore (applied on server) |
void SetDontForceModelDelete | ( | bool | ) |