OCCT3D OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    TDF_Transaction Class Reference

    This class offers services to open, commit or abort a transaction in a more secure way than using Data from TDF. If you forget to close a transaction, it will be automatically aborted at the destruction of this object, at the closure of its scope. More...

    #include <TDF_Transaction.hxx>

    Public Member Functions

     TDF_Transaction (const TCollection_AsciiString &aName="")
     Creates an empty transaction context, unable to be opened.
     TDF_Transaction (const occ::handle< TDF_Data > &aDF, const TCollection_AsciiString &aName="")
     Creates a transaction context on <aDF>, ready to be opened.
    void Initialize (const occ::handle< TDF_Data > &aDF)
     Aborts all the transactions on <myDF> and sets <aDF> to build a transaction context on <aDF>, ready to be opened.
    int Open ()
     If not yet done, opens a new transaction on <myDF>. Returns the index of the just opened transaction.
    occ::handle< TDF_DeltaCommit (const bool withDelta=false)
     Commits the transactions until AND including the current opened one.
    void Abort ()
     Aborts the transactions until AND including the current opened one.
     ~TDF_Transaction ()
    occ::handle< TDF_DataData () const
     Returns the Data from TDF.
    int Transaction () const
     Returns the number of the transaction opened by <me>.
    const TCollection_AsciiStringName () const
     Returns the transaction name.
    bool IsOpen () const
     Returns true if the transaction is open.
    void DumpJson (Standard_OStream &theOStream, int theDepth=-1) const
     Dumps the content of me into the stream.

    Detailed Description

    This class offers services to open, commit or abort a transaction in a more secure way than using Data from TDF. If you forget to close a transaction, it will be automatically aborted at the destruction of this object, at the closure of its scope.

    In case of catching errors, the effect will be the same: aborting transactions until the good current one.

    Constructor & Destructor Documentation

    ◆ TDF_Transaction() [1/2]

    TDF_Transaction::TDF_Transaction ( const TCollection_AsciiString & aName = "")

    Creates an empty transaction context, unable to be opened.

    ◆ TDF_Transaction() [2/2]

    TDF_Transaction::TDF_Transaction ( const occ::handle< TDF_Data > & aDF,
    const TCollection_AsciiString & aName = "" )

    Creates a transaction context on <aDF>, ready to be opened.

    ◆ ~TDF_Transaction()

    TDF_Transaction::~TDF_Transaction ( )
    inline

    Member Function Documentation

    ◆ Abort()

    void TDF_Transaction::Abort ( )

    Aborts the transactions until AND including the current opened one.

    ◆ Commit()

    occ::handle< TDF_Delta > TDF_Transaction::Commit ( const bool withDelta = false)

    Commits the transactions until AND including the current opened one.

    ◆ Data()

    occ::handle< TDF_Data > TDF_Transaction::Data ( ) const

    Returns the Data from TDF.

    ◆ DumpJson()

    void TDF_Transaction::DumpJson ( Standard_OStream & theOStream,
    int theDepth = -1 ) const

    Dumps the content of me into the stream.

    ◆ Initialize()

    void TDF_Transaction::Initialize ( const occ::handle< TDF_Data > & aDF)

    Aborts all the transactions on <myDF> and sets <aDF> to build a transaction context on <aDF>, ready to be opened.

    ◆ IsOpen()

    bool TDF_Transaction::IsOpen ( ) const

    Returns true if the transaction is open.

    ◆ Name()

    const TCollection_AsciiString & TDF_Transaction::Name ( ) const

    Returns the transaction name.

    ◆ Open()

    int TDF_Transaction::Open ( )

    If not yet done, opens a new transaction on <myDF>. Returns the index of the just opened transaction.

    It raises DomainError if the transaction is already open, and NullObject if there is no current Data framework.

    ◆ Transaction()

    int TDF_Transaction::Transaction ( ) const

    Returns the number of the transaction opened by <me>.


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