![]() |
QxOrm 1.4.9
C++ Object Relational Mapping library
|
qx::dao::ptr<T> : provide a classic smart-pointer (like boost::shared_ptr<T> or QSharedPointer<T>) with some features associated with QxDao module of QxOrm library More...
#include <QxDaoPointer.h>
Public Member Functions | |
ptr () | |
ptr (T *ptr) | |
ptr (T *ptr, T *original) | |
ptr (const qx::dao::ptr< T > &other) | |
ptr (const QSharedPointer< T > &other) | |
ptr (const QSharedPointer< T > &other, const QSharedPointer< T > &original) | |
ptr (const QWeakPointer< T > &other) | |
ptr (const QWeakPointer< T > &other, const QWeakPointer< T > &original) | |
virtual | ~ptr () |
template<typename Deleter > | |
ptr (T *ptr, Deleter deleter) | |
template<typename Deleter > | |
ptr (T *ptr, T *original, Deleter deleter) | |
template<class X > | |
ptr (const qx::dao::ptr< X > &other) | |
template<class X > | |
ptr (const QSharedPointer< X > &other) | |
template<class X > | |
ptr (const QSharedPointer< X > &other, const QSharedPointer< T > &original) | |
template<class X > | |
ptr (const QWeakPointer< X > &other) | |
template<class X > | |
ptr (const QWeakPointer< X > &other, const QWeakPointer< X > &original) | |
qx::dao::ptr< T > & | operator= (const qx::dao::ptr< T > &other) |
qx::dao::ptr< T > & | operator= (const QSharedPointer< T > &other) |
qx::dao::ptr< T > & | operator= (const QWeakPointer< T > &other) |
template<class X > | |
qx::dao::ptr< T > & | operator= (const qx::dao::ptr< X > &other) |
template<class X > | |
qx::dao::ptr< T > & | operator= (const QSharedPointer< X > &other) |
template<class X > | |
qx::dao::ptr< T > & | operator= (const QWeakPointer< X > &other) |
T * | get () const |
T * | getOriginal () const |
T * | data () const |
T * | dataOriginal () const |
bool | isNull () const |
operator bool () const | |
bool | operator! () const |
T & | operator* () const |
T * | operator-> () const |
void | clear () |
void | reset () |
void | reset (const QSharedPointer< T > &ptr) |
void | resetOriginal (const QSharedPointer< T > &ptr) |
bool | isDirty () const |
QSharedPointer< T > | toQtSharedPointer () const |
void | saveToOriginal () |
void | restoreFromOriginal () |
template<class X > | |
qx::dao::ptr< X > | staticCast () const |
template<class X > | |
qx::dao::ptr< X > | dynamicCast () const |
template<class X > | |
qx::dao::ptr< X > | constCast () const |
bool | isDirty (QStringList &lstDiff) const |
Private Attributes | |
QSharedPointer< T > | m_pWork |
Default pointer => user works with this pointer. | |
QSharedPointer< T > | m_pOriginal |
Keep original pointer containing all values from database. | |
Friends | |
template<class U > | |
QDataStream & | operator<< (QDataStream &stream, const qx::dao::ptr< U > &t) |
template<class U > | |
QDataStream & | operator>> (QDataStream &stream, qx::dao::ptr< U > &t) |
qx::dao::ptr<T> : provide a classic smart-pointer (like boost::shared_ptr<T> or QSharedPointer<T>) with some features associated with QxDao module of QxOrm library
QxOrm can be used with smart-pointers of boost and Qt libraries. QxOrm smart-pointer is based on QSharedPointer and provides new features with qx::dao::xxx functions of QxDao module. qx::dao::ptr<T> keeps automatically values from database. So it's possible to detect if an instance has been modified using the method isDirty() : this method can return list of properties changed. qx::dao::ptr<T> can also be used with the function qx::dao::update_optimized() to update in database only properties changed. qx::dao::ptr<T> can be used with a simple object and with many containers : stl, boost, Qt and qx::QxCollection<Key, Value>.
Quick sample using qx::dao::ptr<T> smart-pointer :
Definition at line 138 of file QxDaoPointer.h.
|
inline |
Definition at line 151 of file QxDaoPointer.h.
|
inlineexplicit |
Definition at line 152 of file QxDaoPointer.h.
|
inlineexplicit |
Definition at line 153 of file QxDaoPointer.h.
|
inline |
Definition at line 154 of file QxDaoPointer.h.
|
inline |
Definition at line 155 of file QxDaoPointer.h.
|
inline |
Definition at line 156 of file QxDaoPointer.h.
|
inline |
Definition at line 157 of file QxDaoPointer.h.
|
inline |
Definition at line 158 of file QxDaoPointer.h.
|
inlinevirtual |
Definition at line 159 of file QxDaoPointer.h.
|
inline |
Definition at line 161 of file QxDaoPointer.h.
|
inline |
Definition at line 162 of file QxDaoPointer.h.
|
inline |
Definition at line 164 of file QxDaoPointer.h.
|
inline |
Definition at line 165 of file QxDaoPointer.h.
|
inline |
Definition at line 166 of file QxDaoPointer.h.
|
inline |
Definition at line 167 of file QxDaoPointer.h.
|
inline |
Definition at line 168 of file QxDaoPointer.h.
|
inline |
Definition at line 187 of file QxDaoPointer.h.
|
inline |
Definition at line 198 of file QxDaoPointer.h.
|
inline |
Definition at line 180 of file QxDaoPointer.h.
|
inline |
Definition at line 181 of file QxDaoPointer.h.
|
inline |
Definition at line 197 of file QxDaoPointer.h.
|
inline |
Definition at line 178 of file QxDaoPointer.h.
|
inline |
Definition at line 179 of file QxDaoPointer.h.
|
inline |
Definition at line 191 of file QxDaoPointer.h.
|
inline |
Definition at line 200 of file QxDaoPointer.h.
|
inline |
Definition at line 182 of file QxDaoPointer.h.
|
inline |
Definition at line 183 of file QxDaoPointer.h.
|
inline |
Definition at line 184 of file QxDaoPointer.h.
|
inline |
Definition at line 185 of file QxDaoPointer.h.
|
inline |
Definition at line 186 of file QxDaoPointer.h.
|
inline |
Definition at line 171 of file QxDaoPointer.h.
|
inline |
Definition at line 175 of file QxDaoPointer.h.
|
inline |
Definition at line 172 of file QxDaoPointer.h.
|
inline |
Definition at line 176 of file QxDaoPointer.h.
|
inline |
Definition at line 170 of file QxDaoPointer.h.
|
inline |
Definition at line 174 of file QxDaoPointer.h.
|
inline |
Definition at line 188 of file QxDaoPointer.h.
|
inline |
Definition at line 189 of file QxDaoPointer.h.
|
inline |
Definition at line 190 of file QxDaoPointer.h.
|
inline |
Definition at line 194 of file QxDaoPointer.h.
|
inline |
Definition at line 193 of file QxDaoPointer.h.
|
inline |
Definition at line 196 of file QxDaoPointer.h.
|
inline |
Definition at line 192 of file QxDaoPointer.h.
|
friend |
|
friend |
|
private |
Keep original pointer containing all values from database.
Definition at line 147 of file QxDaoPointer.h.
|
private |
Default pointer => user works with this pointer.
Definition at line 146 of file QxDaoPointer.h.