App::Transaction Class Reference

Represents a atomic transaction of the document. More...

#include <Transactions.h>

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

List of all members.

Public Member Functions

void apply (Document &Doc, bool forward)
 apply the content to the document
virtual unsigned int getMemSize (void) const
 This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB?
int getPos (void) const
 get the position in the transaction history
virtual Base::Type getTypeId (void) const
virtual void Restore (Base::XMLReader &reader)
 This method is used to restore properties from an XML document.
virtual void Save (Base::Writer &writer) const
 This method is used to save properties to an XML document.
 Transaction (int pos)
 Construction.
 Transaction ()
 Construction.
virtual ~Transaction ()
 Destruction.

Static Public Member Functions

static void * create (void)
static Base::Type getClassTypeId (void)
static void init (void)

Public Attributes

std::string Name

Protected Member Functions

void addObjectChange (const DocumentObject *Obj, const Property *Prop)
void addObjectDel (const DocumentObject *Obj)
void addObjectNew (DocumentObject *Obj)

Friends

class Document

Detailed Description

Represents a atomic transaction of the document.

Definition at line 71 of file Transactions.h.


Constructor & Destructor Documentation

Transaction::Transaction (  ) 

Construction.

Definition at line 48 of file Transactions.cpp.

Transaction::Transaction ( int  pos  ) 

Construction.

Definition at line 53 of file Transactions.cpp.

Transaction::~Transaction (  )  [virtual]

Destruction.

A destructor.

A more elaborate description of the destructor.

Definition at line 62 of file Transactions.cpp.

References App::TransactionObject::New.


Member Function Documentation

void Transaction::addObjectChange ( const DocumentObject Obj,
const Property Prop 
) [protected]
void Transaction::addObjectDel ( const DocumentObject Obj  )  [protected]
void Transaction::addObjectNew ( DocumentObject Obj  )  [protected]
void Transaction::apply ( Document Doc,
bool  forward 
)

apply the content to the document

Definition at line 110 of file Transactions.cpp.

Referenced by App::Document::abortTransaction().

void * App::Transaction::create ( void   )  [static]

Reimplemented from Base::Persistence.

Definition at line 43 of file Transactions.cpp.

Base::Type App::Transaction::getClassTypeId ( void   )  [static]

Reimplemented from Base::Persistence.

Definition at line 43 of file Transactions.cpp.

unsigned int Transaction::getMemSize ( void   )  const [virtual]

This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB?

Implements Base::Persistence.

Definition at line 85 of file Transactions.cpp.

int Transaction::getPos ( void   )  const

get the position in the transaction history

Definition at line 100 of file Transactions.cpp.

Base::Type App::Transaction::getTypeId ( void   )  const [virtual]

Reimplemented from Base::Persistence.

Definition at line 43 of file Transactions.cpp.

void App::Transaction::init ( void   )  [static]

Reimplemented from Base::Persistence.

Definition at line 43 of file Transactions.cpp.

void Transaction::Restore ( Base::XMLReader reader  )  [virtual]

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

Implements Base::Persistence.

Definition at line 95 of file Transactions.cpp.

void Transaction::Save ( Base::Writer  )  const [virtual]

This method is used to save properties to an XML document.

A good example you'll find in PropertyStandard.cpp, e.g. the vector:

  void PropertyVector::Save (Writer &writer) const
  {
     writer << writer.ind() << "<PropertyVector valueX=\"" <<  _cVec.x <<
                                            "\" valueY=\"" <<  _cVec.y <<
                                            "\" valueZ=\"" <<  _cVec.z <<"\"/>" << endl;
  }

The writer.ind() expression writes the indention, just for pretty printing of the XML. As you see, the writing of the XML document is not done with a DOM implementation because of performance reasons. Therefore the programmer has to take care that a valid XML document is written. This means closing tags and writing UTF-8.

See also:
Base::Writer

Implements Base::Persistence.

Definition at line 90 of file Transactions.cpp.


Friends And Related Function Documentation

friend class Document [friend]

Definition at line 97 of file Transactions.h.


Member Data Documentation


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

Generated on Wed Nov 23 19:01:45 2011 for FreeCAD by  doxygen 1.6.1