Open CASCADE Technology  6.9.0
Public Member Functions
TDocStd_MultiTransactionManager Class Reference

Class for synchronization of transactions within multiple documents. Each transaction of this class involvess one transaction in each modified document. More...

#include <TDocStd_MultiTransactionManager.hxx>

Inheritance diagram for TDocStd_MultiTransactionManager:
Inheritance graph
[legend]

Public Member Functions

 TDocStd_MultiTransactionManager ()
 Constructor. More...
 
void SetUndoLimit (const Standard_Integer theLimit)
 Sets undo limit for the manager and all documents. More...
 
Standard_Integer GetUndoLimit () const
 Returns undo limit for the manager. More...
 
void Undo ()
 Undoes the current transaction of the manager. It calls the Undo () method of the document being on top of the manager list of undos (list.First()) and moves the list item to the top of the list of manager redos (list.Prepend(item)). More...
 
void Redo ()
 Redoes the current transaction of the application. It calls the Redo () method of the document being on top of the manager list of redos (list.First()) and moves the list item to the top of the list of manager undos (list.Prepend(item)). More...
 
const
TDocStd_SequenceOfApplicationDelta
GetAvailableUndos () const
 Returns available manager undos. More...
 
const
TDocStd_SequenceOfApplicationDelta
GetAvailableRedos () const
 Returns available manager redos. More...
 
void OpenCommand ()
 Opens transaction in each document and sets the flag that transaction is opened. If there are already opened transactions in the documents, these transactions will be aborted before openning new ones. More...
 
void AbortCommand ()
 Unsets the flag of started manager transaction and aborts transaction in each document. More...
 
Standard_Boolean CommitCommand ()
 Commits transaction in all documents and fills the transaction manager with the documents that have been changed during the transaction. Returns True if new data has been added to myUndos. NOTE: All nested transactions in the documents will be commited. More...
 
Standard_Boolean CommitCommand (const TCollection_ExtendedString &theName)
 Makes the same steps as the previous function but defines the name for transaction. Returns True if new data has been added to myUndos. More...
 
Standard_Boolean HasOpenCommand () const
 Returns true if a transaction is opened. More...
 
void RemoveLastUndo ()
 Removes undo information from the list of undos of the manager and all documents which have been modified during the transaction. More...
 
void DumpTransaction (Standard_OStream &theOS) const
 Dumps transactions in undos and redos. More...
 
void AddDocument (const Handle< TDocStd_Document > &theDoc)
 Adds the document to the transaction manager and checks if it has been already added. More...
 
void RemoveDocument (const Handle< TDocStd_Document > &theDoc)
 Removes the document from the transaction manager. More...
 
const TDocStd_SequenceOfDocumentDocuments () const
 Returns the added documents to the transaction manager. More...
 
void SetNestedTransactionMode (const Standard_Boolean isAllowed=Standard_True)
 Sets nested transaction mode if isAllowed == Standard_True NOTE: field myIsNestedTransactionMode exists only for synchronization between several documents and has no effect on transactions of multitransaction manager. More...
 
Standard_Boolean IsNestedTransactionMode () const
 Returns Standard_True if NestedTransaction mode is set. Methods for protection of changes outside transactions. More...
 
void SetModificationMode (const Standard_Boolean theTransactionOnly)
 If theTransactionOnly is True, denies all changes outside transactions. More...
 
Standard_Boolean ModificationMode () const
 Returns True if changes are allowed only inside transactions. More...
 
void ClearUndos ()
 Clears undos in the manager and in documents. More...
 
void ClearRedos ()
 Clears redos in the manager and in documents. More...
 
- Public Member Functions inherited from MMgt_TShared
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual const
Handle_Standard_Type & 
DynamicType () const
 Returns a type information object about this object. More...
 
Standard_Boolean IsInstance (const Handle_Standard_Type &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const Handle_Standard_Type &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
virtual Handle_Standard_Transient This () const
 Returns a Handle which references this object. Must never be called to objects created in stack. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 

Detailed Description

Class for synchronization of transactions within multiple documents. Each transaction of this class involvess one transaction in each modified document.

The documents to be synchronized should be added explicitly to the manager; then its interface is uesd to ensure that all transactions (Open/Commit, Undo/Redo) are performed synchronously in all managed documents.

The current implementation does not support nested transactions on multitransaction manager level. It only sets the flag enabling or disabling nested transactions in all its documents, so that a nested transaction can be opened for each particular document with TDocStd_Document class interface.

NOTE: When you invoke CommitTransaction of multi transaction manager, all nested transaction of its documents will be closed (commited).

Constructor & Destructor Documentation

TDocStd_MultiTransactionManager::TDocStd_MultiTransactionManager ( )

Constructor.

Member Function Documentation

void TDocStd_MultiTransactionManager::AbortCommand ( )

Unsets the flag of started manager transaction and aborts transaction in each document.

void TDocStd_MultiTransactionManager::AddDocument ( const Handle< TDocStd_Document > &  theDoc)

Adds the document to the transaction manager and checks if it has been already added.

void TDocStd_MultiTransactionManager::ClearRedos ( )

Clears redos in the manager and in documents.

void TDocStd_MultiTransactionManager::ClearUndos ( )

Clears undos in the manager and in documents.

Standard_Boolean TDocStd_MultiTransactionManager::CommitCommand ( )

Commits transaction in all documents and fills the transaction manager with the documents that have been changed during the transaction. Returns True if new data has been added to myUndos. NOTE: All nested transactions in the documents will be commited.

Standard_Boolean TDocStd_MultiTransactionManager::CommitCommand ( const TCollection_ExtendedString theName)

Makes the same steps as the previous function but defines the name for transaction. Returns True if new data has been added to myUndos.

const TDocStd_SequenceOfDocument& TDocStd_MultiTransactionManager::Documents ( ) const

Returns the added documents to the transaction manager.

void TDocStd_MultiTransactionManager::DumpTransaction ( Standard_OStream theOS) const

Dumps transactions in undos and redos.

const TDocStd_SequenceOfApplicationDelta& TDocStd_MultiTransactionManager::GetAvailableRedos ( ) const

Returns available manager redos.

const TDocStd_SequenceOfApplicationDelta& TDocStd_MultiTransactionManager::GetAvailableUndos ( ) const

Returns available manager undos.

Standard_Integer TDocStd_MultiTransactionManager::GetUndoLimit ( ) const

Returns undo limit for the manager.

Standard_Boolean TDocStd_MultiTransactionManager::HasOpenCommand ( ) const

Returns true if a transaction is opened.

Standard_Boolean TDocStd_MultiTransactionManager::IsNestedTransactionMode ( ) const

Returns Standard_True if NestedTransaction mode is set. Methods for protection of changes outside transactions.

Standard_Boolean TDocStd_MultiTransactionManager::ModificationMode ( ) const

Returns True if changes are allowed only inside transactions.

void TDocStd_MultiTransactionManager::OpenCommand ( )

Opens transaction in each document and sets the flag that transaction is opened. If there are already opened transactions in the documents, these transactions will be aborted before openning new ones.

void TDocStd_MultiTransactionManager::Redo ( )

Redoes the current transaction of the application. It calls the Redo () method of the document being on top of the manager list of redos (list.First()) and moves the list item to the top of the list of manager undos (list.Prepend(item)).

void TDocStd_MultiTransactionManager::RemoveDocument ( const Handle< TDocStd_Document > &  theDoc)

Removes the document from the transaction manager.

void TDocStd_MultiTransactionManager::RemoveLastUndo ( )

Removes undo information from the list of undos of the manager and all documents which have been modified during the transaction.

void TDocStd_MultiTransactionManager::SetModificationMode ( const Standard_Boolean  theTransactionOnly)

If theTransactionOnly is True, denies all changes outside transactions.

void TDocStd_MultiTransactionManager::SetNestedTransactionMode ( const Standard_Boolean  isAllowed = Standard_True)

Sets nested transaction mode if isAllowed == Standard_True NOTE: field myIsNestedTransactionMode exists only for synchronization between several documents and has no effect on transactions of multitransaction manager.

void TDocStd_MultiTransactionManager::SetUndoLimit ( const Standard_Integer  theLimit)

Sets undo limit for the manager and all documents.

void TDocStd_MultiTransactionManager::Undo ( )

Undoes the current transaction of the manager. It calls the Undo () method of the document being on top of the manager list of undos (list.First()) and moves the list item to the top of the list of manager redos (list.Prepend(item)).


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