1 #ifndef CSM_WOLRD_RECORD_H
2 #define CSM_WOLRD_RECORD_H
37 template <
typename ESXRecordT>
46 const ESXRecordT *base = 0,
const ESXRecordT *modified = 0);
54 const ESXRecordT&
get()
const;
60 const ESXRecordT&
getBase()
const;
70 template <
typename ESXRecordT>
72 : mBase(), mModified()
75 template <
typename ESXRecordT>
82 mModified = *modified;
87 template <
typename ESXRecordT>
93 template <
typename ESXRecordT>
99 template <
typename ESXRecordT>
105 template <
typename ESXRecordT>
108 if (mState==State_Erased)
109 throw std::logic_error (
"attempt to access a deleted record");
111 return mState==State_BaseOnly || mState==State_Deleted ? mBase : mModified;
114 template <
typename ESXRecordT>
117 if (mState==State_Erased)
118 throw std::logic_error (
"attempt to access a deleted record");
120 return mState==State_BaseOnly || mState==State_Deleted ? mBase : mModified;
123 template <
typename ESXRecordT>
126 if (mState==State_Erased)
127 throw std::logic_error (
"attempt to access a deleted record");
129 return mState==State_ModifiedOnly ? mModified : mBase;
132 template <
typename ESXRecordT>
135 if (mState==State_Erased)
136 throw std::logic_error (
"attempt to modify a deleted record");
138 mModified = modified;
140 if (mState!=State_ModifiedOnly)
144 template <
typename ESXRecordT>
150 mState = State_BaseOnly;
152 else if (mState==State_Deleted)
154 mState = State_Erased;
virtual RecordBase * clone() const
Definition: record.hpp:94
State mState
Definition: record.hpp:19
virtual RecordBase * modifiedCopy() const =0
Definition: record.hpp:13
State
Definition: record.hpp:10
virtual RecordBase * clone() const =0
Record()
Definition: record.hpp:71
Definition: nestedcolumnadapter.hpp:11
ESXRecordT mBase
Definition: record.hpp:40
Definition: record.hpp:14
virtual void assign(const RecordBase &record)
Will throw an exception if the types don't match.
Definition: record.hpp:100
bool isErased() const
Definition: record.cpp:11
virtual RecordBase * modifiedCopy() const
Definition: record.hpp:88
Definition: record.hpp:12
Definition: record.hpp:15
ESXRecordT mModified
Definition: record.hpp:41
const ESXRecordT & getBase() const
Throws an exception, if the record is deleted. Returns modified, if there is no base.
Definition: record.hpp:124
const ESXRecordT & get() const
Throws an exception, if the record is deleted.
Definition: record.hpp:106
void setModified(const ESXRecordT &modified)
Throws an exception, if the record is deleted.
Definition: record.hpp:133
virtual void assign(const RecordBase &record)=0
Will throw an exception if the types don't match.
virtual ~RecordBase()
Definition: record.cpp:3
void merge()
Merge modified into base.
Definition: record.hpp:145
Definition: record.hpp:16
bool isModified() const
Definition: record.cpp:17
bool isDeleted() const
Definition: record.cpp:5