OpenLexocad  27.1
Core::Transaction Class Reference

#include <Transaction.h>

Inheritance diagram for Core::Transaction:
Base::Persistence Base::BaseClass

Public Member Functions

 Transaction (int id=0)
 
virtual ~Transaction ()
 Construction. More...
 
void apply (CoreDocument &Doc, bool forward)
 apply the content to the document More...
 
virtual void save (Base::AbstractWriter &, Base::PersistenceVersion &)
 This method is used to save properties or very small amounts of data to an XML document. More...
 
virtual void restore (Base::AbstractXMLReader &, Base::PersistenceVersion &)
 This method is used to restore properties from an XML document. More...
 
int getID (void) const
 Return the transaction ID. More...
 
bool isEmpty () const
 Returns true if the transaction list is empty; otherwise returns false. More...
 
bool hasObject (const Core::DocObject *Obj) const
 check if this object is used in a transaction More...
 
void addOrRemoveProperty (Core::DocObject *Obj, const Property *pcProp, bool add)
 
void addObjectNew (Core::DocObject *Obj)
 
void addObjectDel (const Core::DocObject *Obj)
 
void addObjectChange (const Core::DocObject *Obj, const Property *Prop)
 
- Public Member Functions inherited from Base::Persistence
virtual void saveDocFile (Base::AbstractWriter &, const Base::String &, const Base::String &)
 This method is used to save large amounts of data to a binary file. More...
 
virtual void restoreDocFile (Base::Reader &, const Base::String &)
 This method is used to restore large amounts of data from a binary file. More...
 
virtual bool mustbeSaved () const
 Return 'true' if this object must always be saved in the file. More...
 
virtual bool createSQL (Base::AbstractWriter &, Base::PersistenceVersion &, bool)
 This method is used to save properties or very small amounts of data to an XML document. More...
 
- Public Member Functions inherited from Base::BaseClass
virtual Type getTypeId (void) const
 
template<typename T >
bool isDerivedFrom () const
 
bool isDerivedFrom (const Type type) const
 
 BaseClass ()
 Construction. More...
 
virtual ~BaseClass ()
 Destruction. More...
 

Static Public Member Functions

static int getNewID (void)
 Generate a new unique transaction ID. More...
 
static int getLastID (void)
 
- Static Public Member Functions inherited from Base::Persistence
static std::string encodeAttribute (const std::string &)
 
- Static Public Member Functions inherited from Base::BaseClass
static Type getClassTypeId (void)
 
static void init (void)
 
static void * create (void)
 
static void setIfcNameAndID (const std::string &n, int id)
 

Public Attributes

std::string Name
 
- Public Attributes inherited from Base::BaseClass
long ____deadVal = 0xBADEAFFE
 

Additional Inherited Members

- Static Protected Member Functions inherited from Base::BaseClass
static void initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=0)
 
static void initIfcTypes (const std::string &s, Base::Type classTypeId, int id)
 

Detailed Description

Represents a atomic transaction of the document

Constructor & Destructor Documentation

◆ Transaction()

Core::Transaction::Transaction ( int  id = 0)

Construction

Parameters
idtransaction id. If zero, then it will be generated automatically as a monotonically increasing index across the entire application. User can pass in a transaction id to group multiple transactions from different document, so that they can be undo/redo together.

◆ ~Transaction()

virtual Core::Transaction::~Transaction ( )
virtual

Construction.

Member Function Documentation

◆ addObjectChange()

void Core::Transaction::addObjectChange ( const Core::DocObject Obj,
const Property Prop 
)

◆ addObjectDel()

void Core::Transaction::addObjectDel ( const Core::DocObject Obj)

◆ addObjectNew()

void Core::Transaction::addObjectNew ( Core::DocObject Obj)

◆ addOrRemoveProperty()

void Core::Transaction::addOrRemoveProperty ( Core::DocObject Obj,
const Property pcProp,
bool  add 
)

◆ apply()

void Core::Transaction::apply ( CoreDocument Doc,
bool  forward 
)

apply the content to the document

◆ getID()

int Core::Transaction::getID ( void  ) const

Return the transaction ID.

◆ getLastID()

static int Core::Transaction::getLastID ( void  )
static

◆ getNewID()

static int Core::Transaction::getNewID ( void  )
static

Generate a new unique transaction ID.

◆ hasObject()

bool Core::Transaction::hasObject ( const Core::DocObject Obj) const

check if this object is used in a transaction

◆ isEmpty()

bool Core::Transaction::isEmpty ( ) const

Returns true if the transaction list is empty; otherwise returns false.

◆ restore()

virtual void Core::Transaction::restore ( Base::AbstractXMLReader ,
Base::PersistenceVersion  
)
virtual

This method is used to restore properties from an XML document.

Implements Base::Persistence.

◆ save()

virtual void Core::Transaction::save ( Base::AbstractWriter ,
Base::PersistenceVersion  
)
virtual

This method is used to save properties or very small amounts of data to an XML document.

Implements Base::Persistence.

Member Data Documentation

◆ Name

std::string Core::Transaction::Name

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