Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
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.
 
void SetUndoLimit (const int theLimit)
 Sets undo limit for the manager and all documents.
 
int GetUndoLimit () const
 Returns undo limit for the manager.
 
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)).
 
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)).
 
const NCollection_Sequence< occ::handle< TDocStd_ApplicationDelta > > & GetAvailableUndos () const
 Returns available manager undos.
 
const NCollection_Sequence< occ::handle< TDocStd_ApplicationDelta > > & GetAvailableRedos () const
 Returns available manager redos.
 
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 opening new ones.
 
void AbortCommand ()
 Unsets the flag of started manager transaction and aborts transaction in each document.
 
bool 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 committed.
 
bool 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.
 
bool HasOpenCommand () const
 Returns true if a transaction is opened.
 
void RemoveLastUndo ()
 Removes undo information from the list of undos of the manager and all documents which have been modified during the transaction.
 
void DumpTransaction (Standard_OStream &theOS) const
 Dumps transactions in undos and redos.
 
void AddDocument (const occ::handle< TDocStd_Document > &theDoc)
 Adds the document to the transaction manager and checks if it has been already added.
 
void RemoveDocument (const occ::handle< TDocStd_Document > &theDoc)
 Removes the document from the transaction manager.
 
const NCollection_Sequence< occ::handle< TDocStd_Document > > & Documents () const
 Returns the added documents to the transaction manager.
 
void SetNestedTransactionMode (const bool isAllowed=true)
 Sets nested transaction mode if isAllowed == true NOTE: field myIsNestedTransactionMode exists only for synchronization between several documents and has no effect on transactions of multitransaction manager.
 
bool IsNestedTransactionMode () const
 Returns true if NestedTransaction mode is set. Methods for protection of changes outside transactions.
 
void SetModificationMode (const bool theTransactionOnly)
 If theTransactionOnly is True, denies all changes outside transactions.
 
bool ModificationMode () const
 Returns True if changes are allowed only inside transactions.
 
void ClearUndos ()
 Clears undos in the manager and in documents.
 
void ClearRedos ()
 Clears redos in the manager and in documents.
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter.
 
virtual ~Standard_Transient ()=default
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
bool IsInstance (const char *const theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
bool IsKind (const opencascade::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.
 
bool IsKind (const char *const 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.
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero.
 
int GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
 
int DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 
- Static Public Member Functions inherited from Standard_Transient
static constexpr const charget_type_name ()
 Returns a type descriptor about this object.
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class.
 

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 used 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 (committed).

Constructor & Destructor Documentation

◆ TDocStd_MultiTransactionManager()

TDocStd_MultiTransactionManager::TDocStd_MultiTransactionManager ( )

Constructor.

Member Function Documentation

◆ AbortCommand()

void TDocStd_MultiTransactionManager::AbortCommand ( )

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

◆ AddDocument()

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

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

◆ ClearRedos()

void TDocStd_MultiTransactionManager::ClearRedos ( )

Clears redos in the manager and in documents.

◆ ClearUndos()

void TDocStd_MultiTransactionManager::ClearUndos ( )

Clears undos in the manager and in documents.

◆ CommitCommand() [1/2]

bool 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 committed.

◆ CommitCommand() [2/2]

bool 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.

◆ Documents()

const NCollection_Sequence< occ::handle< TDocStd_Document > > & TDocStd_MultiTransactionManager::Documents ( ) const

Returns the added documents to the transaction manager.

◆ DumpTransaction()

void TDocStd_MultiTransactionManager::DumpTransaction ( Standard_OStream & theOS) const

Dumps transactions in undos and redos.

◆ GetAvailableRedos()

const NCollection_Sequence< occ::handle< TDocStd_ApplicationDelta > > & TDocStd_MultiTransactionManager::GetAvailableRedos ( ) const

Returns available manager redos.

◆ GetAvailableUndos()

const NCollection_Sequence< occ::handle< TDocStd_ApplicationDelta > > & TDocStd_MultiTransactionManager::GetAvailableUndos ( ) const

Returns available manager undos.

◆ GetUndoLimit()

int TDocStd_MultiTransactionManager::GetUndoLimit ( ) const

Returns undo limit for the manager.

◆ HasOpenCommand()

bool TDocStd_MultiTransactionManager::HasOpenCommand ( ) const

Returns true if a transaction is opened.

◆ IsNestedTransactionMode()

bool TDocStd_MultiTransactionManager::IsNestedTransactionMode ( ) const

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

◆ ModificationMode()

bool TDocStd_MultiTransactionManager::ModificationMode ( ) const

Returns True if changes are allowed only inside transactions.

◆ OpenCommand()

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 opening new ones.

◆ Redo()

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)).

◆ RemoveDocument()

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

Removes the document from the transaction manager.

◆ RemoveLastUndo()

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.

◆ SetModificationMode()

void TDocStd_MultiTransactionManager::SetModificationMode ( const bool theTransactionOnly)

If theTransactionOnly is True, denies all changes outside transactions.

◆ SetNestedTransactionMode()

void TDocStd_MultiTransactionManager::SetNestedTransactionMode ( const bool isAllowed = true)

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

◆ SetUndoLimit()

void TDocStd_MultiTransactionManager::SetUndoLimit ( const int theLimit)

Sets undo limit for the manager and all documents.

◆ Undo()

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: