| 247 | |
| 248 | template <typename T> |
| 249 | struct db_ref |
| 250 | { |
| 251 | db_ref(const cache::cache_record& c) : _cr(c) {} |
| 252 | |
| 253 | const T* operator->() const { return reinterpret_cast<const T*>(_cr.data()); } |
| 254 | |
| 255 | T* operator->() { return reinterpret_cast<T*>(_cr.modify().data()); } |
| 256 | |
| 257 | operator db_ptr<T>() const { return db_ptr<T>(_cr.handle()); } |
| 258 | operator db_handle() const { return _cr.handle(); } |
| 259 | |
| 260 | private: |
| 261 | const cache::cache_record& _cr; |
| 262 | }; |
| 263 | |
| 264 | template <typename T> |
| 265 | struct db_ptr |