Represents an entry for an object in a Transaction. More...
#include <Transactions.h>
Public Member Functions | |
void | applyChn (Document &Doc, DocumentObject *pcObj, bool Forward) |
void | applyDel (Document &Doc, DocumentObject *pcObj) |
void | applyNew (Document &Doc, DocumentObject *pcObj) |
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? | |
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. | |
void | setProperty (const Property *pcProp) |
TransactionObject (const DocumentObject *pcObj, const char *NameInDocument=0) | |
Construction. | |
virtual | ~TransactionObject () |
Destruction. | |
Static Public Member Functions | |
static void * | create (void) |
static Base::Type | getClassTypeId (void) |
static void | init (void) |
Protected Types | |
enum | Status { New, Del, Chn } |
Protected Attributes | |
std::string | _NameInDocument |
std::map< const Property *, Property * > | _PropChangeMap |
enum App::TransactionObject::Status | status |
Friends | |
class | Transaction |
Represents an entry for an object in a Transaction.
Definition at line 40 of file Transactions.h.
enum App::TransactionObject::Status [protected] |
Definition at line 64 of file Transactions.h.
TransactionObject::TransactionObject | ( | const DocumentObject * | pcObj, | |
const char * | NameInDocument = 0 | |||
) |
Construction.
A constructor.
A more elaborate description of the constructor.
Definition at line 200 of file Transactions.cpp.
References _NameInDocument.
TransactionObject::~TransactionObject | ( | ) | [virtual] |
Destruction.
A destructor.
A more elaborate description of the destructor.
Definition at line 211 of file Transactions.cpp.
References _PropChangeMap.
void TransactionObject::applyChn | ( | Document & | Doc, | |
DocumentObject * | pcObj, | |||
bool | Forward | |||
) |
Definition at line 233 of file Transactions.cpp.
References _PropChangeMap, Chn, New, and status.
void TransactionObject::applyDel | ( | Document & | Doc, | |
DocumentObject * | pcObj | |||
) |
Definition at line 218 of file Transactions.cpp.
References App::Document::_remObject(), Del, and status.
void TransactionObject::applyNew | ( | Document & | Doc, | |
DocumentObject * | pcObj | |||
) |
Definition at line 226 of file Transactions.cpp.
References App::Document::_addObject(), _NameInDocument, New, and status.
void * App::TransactionObject::create | ( | void | ) | [static] |
Reimplemented from Base::Persistence.
Definition at line 191 of file Transactions.cpp.
Base::Type App::TransactionObject::getClassTypeId | ( | void | ) | [static] |
Reimplemented from Base::Persistence.
Definition at line 191 of file Transactions.cpp.
unsigned int TransactionObject::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 256 of file Transactions.cpp.
Base::Type App::TransactionObject::getTypeId | ( | void | ) | const [virtual] |
Reimplemented from Base::Persistence.
Definition at line 191 of file Transactions.cpp.
void App::TransactionObject::init | ( | void | ) | [static] |
Reimplemented from Base::Persistence.
Definition at line 191 of file Transactions.cpp.
void TransactionObject::Restore | ( | Base::XMLReader & | reader | ) | [virtual] |
This method is used to restore properties from an XML document.
Implements Base::Persistence.
Definition at line 266 of file Transactions.cpp.
void TransactionObject::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.
Implements Base::Persistence.
Definition at line 261 of file Transactions.cpp.
void TransactionObject::setProperty | ( | const Property * | pcProp | ) |
Definition at line 249 of file Transactions.cpp.
References _PropChangeMap, App::Property::Copy(), and RobotExample::pos.
Referenced by App::Transaction::addObjectChange().
friend class Transaction [friend] |
Definition at line 61 of file Transactions.h.
std::string App::TransactionObject::_NameInDocument [protected] |
Definition at line 66 of file Transactions.h.
Referenced by applyNew(), and TransactionObject().
std::map<const Property*,Property*> App::TransactionObject::_PropChangeMap [protected] |
Definition at line 65 of file Transactions.h.
Referenced by applyChn(), setProperty(), and ~TransactionObject().
enum App::TransactionObject::Status App::TransactionObject::status [protected] |