buffer.hxx   buffer.hxx 
skipping to change at line 20 skipping to change at line 20
#include <new> #include <new>
#include <cstddef> // std::size_t #include <cstddef> // std::size_t
#include <odb/details/export.hxx> #include <odb/details/export.hxx>
namespace odb namespace odb
{ {
namespace details namespace details
{ {
class LIBODB_EXPORT buffer class LIBODB_EXPORT basic_buffer_base
{ {
public: public:
~buffer () ~basic_buffer_base ()
{ {
if (data_) if (data_)
operator delete (data_); operator delete (data_);
} }
buffer () basic_buffer_base ()
: capacity_ (512) : capacity_ (512)
{ {
data_ = static_cast<char*> (operator new (capacity_)); data_ = operator new (capacity_);
}
char*
data ()
{
return data_;
}
const char*
data () const
{
return data_;
} }
std::size_t std::size_t
capacity () const capacity () const
{ {
return capacity_; return capacity_;
} }
void void
capacity (std::size_t, std::size_t data_size = 0); capacity (std::size_t, std::size_t data_size = 0);
private: protected:
char* data_; void* data_;
std::size_t capacity_; std::size_t capacity_;
}; };
template <typename T>
class basic_buffer: public basic_buffer_base
{
public:
T*
data ()
{
return static_cast<T*> (data_);
}
const T*
data () const
{
return static_cast<T*> (data_);
}
};
typedef basic_buffer<char> buffer;
typedef basic_buffer<unsigned char> ubuffer;
} }
} }
#include <odb/post.hxx> #include <odb/post.hxx>
#endif // ODB_BUFFER_DETAILS_HXX #endif // ODB_BUFFER_DETAILS_HXX
 End of changes. 6 change blocks. 
19 lines changed or deleted 28 lines changed or added


 database.ixx   database.ixx 
skipping to change at line 107 skipping to change at line 107
template <typename T> template <typename T>
inline void database:: inline void database::
update (const typename object_traits<T>::pointer_type& pobj) update (const typename object_traits<T>::pointer_type& pobj)
{ {
update_<T> (pobj); update_<T> (pobj);
} }
template <typename T> template <typename T>
inline void database:: inline void database::
erase (T& obj)
{
// T can be const T while object_type will always be T.
//
typedef typename odb::object_traits<T>::object_type object_type;
typedef odb::object_traits<object_type> object_traits;
erase<T> (object_traits::id (obj));
}
template <typename T>
inline void database::
erase (T* p) erase (T* p)
{ {
typedef typename object_traits<T>::pointer_type object_pointer; typedef typename object_traits<T>::pointer_type object_pointer;
// The passed pointer should be the same or implicit-convertible // The passed pointer should be the same or implicit-convertible
// to the object pointer. This way we make sure the object pointer // to the object pointer. This way we make sure the object pointer
// does not assume ownership of the passed object. // does not assume ownership of the passed object.
// //
const object_pointer& pobj (p); const object_pointer& pobj (p);
skipping to change at line 166 skipping to change at line 154
inline void database:: inline void database::
erase (const typename object_traits<T>::pointer_type& pobj) erase (const typename object_traits<T>::pointer_type& pobj)
{ {
erase_<T> (pobj); erase_<T> (pobj);
} }
template <typename T> template <typename T>
inline void database:: inline void database::
erase_ (const typename object_traits<T>::pointer_type& pobj) erase_ (const typename object_traits<T>::pointer_type& pobj)
{ {
// T can be const T while object_type will always be T. typedef typename object_traits<T>::pointer_type pointer_type;
// typedef pointer_traits<pointer_type> pointer_traits;
typedef typename odb::object_traits<T>::object_type object_type;
typedef odb::object_traits<object_type> object_traits;
typedef typename odb::object_traits<T>::pointer_type pointer_type;
typedef odb::pointer_traits<pointer_type> pointer_traits;
erase<T> (object_traits::id (pointer_traits::get_ref (pobj))); erase<T> (pointer_traits::get_ref (pobj));
} }
template <typename T> template <typename T>
inline result<T> database:: inline result<T> database::
query (bool cache) query (bool cache)
{ {
// T can be const T while object_type will always be T. // T can be const T while object_type will always be T.
// //
typedef typename odb::object_traits<T>::object_type object_type; typedef typename odb::object_traits<T>::object_type object_type;
 End of changes. 3 change blocks. 
20 lines changed or deleted 3 lines changed or added


 database.txx   database.txx 
// file : odb/database.txx // file : odb/database.txx
// author : Boris Kolpackov <boris@codesynthesis.com> // author : Boris Kolpackov <boris@codesynthesis.com>
// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
// license : GNU GPL v2; see accompanying LICENSE file // license : GNU GPL v2; see accompanying LICENSE file
#include <odb/exceptions.hxx> #include <odb/exceptions.hxx>
#include <odb/transaction.hxx> #include <odb/transaction.hxx>
#include <odb/session.hxx> #include <odb/session.hxx>
#include <odb/callback.hxx>
#include <odb/cache-traits.hxx> #include <odb/cache-traits.hxx>
#include <odb/pointer-traits.hxx> #include <odb/pointer-traits.hxx>
namespace odb namespace odb
{ {
template <typename T> template <typename T>
typename object_traits<T>::id_type database:: typename object_traits<T>::id_type database::
persist (T& obj) persist (T& obj)
{ {
// T can be const T while object_type will always be T. // T can be const T while object_type will always be T.
// //
typedef typename odb::object_traits<T>::object_type object_type; typedef typename odb::object_traits<T>::object_type object_type;
typedef odb::object_traits<object_type> object_traits; typedef odb::object_traits<object_type> object_traits;
if (!transaction::has_current ()) if (!transaction::has_current ())
throw not_in_transaction (); throw not_in_transaction ();
object_traits::callback (*this, obj, callback_event::pre_persist);
object_traits::persist (*this, obj); object_traits::persist (*this, obj);
object_traits::callback (*this, obj, callback_event::post_persist);
const typename object_traits::id_type& id (object_traits::id (obj)); const typename object_traits::id_type& id (object_traits::id (obj));
reference_cache_traits<T>::insert (*this, id, obj); reference_cache_traits<T>::insert (*this, id, obj);
return id; return id;
} }
template <typename T> template <typename T>
typename object_traits<T>::id_type database:: typename object_traits<T>::id_type database::
persist_ (const typename object_traits<T>::pointer_type& pobj) persist_ (const typename object_traits<T>::pointer_type& pobj)
{ {
// T can be const T while object_type will always be T. // T can be const T while object_type will always be T.
skipping to change at line 48 skipping to change at line 52
typedef typename odb::object_traits<T>::object_type object_type; typedef typename odb::object_traits<T>::object_type object_type;
typedef odb::object_traits<object_type> object_traits; typedef odb::object_traits<object_type> object_traits;
typedef typename odb::object_traits<T>::pointer_type pointer_type; typedef typename odb::object_traits<T>::pointer_type pointer_type;
typedef odb::pointer_traits<pointer_type> pointer_traits; typedef odb::pointer_traits<pointer_type> pointer_traits;
if (!transaction::has_current ()) if (!transaction::has_current ())
throw not_in_transaction (); throw not_in_transaction ();
T& obj (pointer_traits::get_ref (pobj)); T& obj (pointer_traits::get_ref (pobj));
object_traits::callback (*this, obj, callback_event::pre_persist);
object_traits::persist (*this, obj); object_traits::persist (*this, obj);
object_traits::callback (*this, obj, callback_event::post_persist);
const typename object_traits::id_type& id (object_traits::id (obj)); const typename object_traits::id_type& id (object_traits::id (obj));
pointer_cache_traits<pointer_type>::insert (*this, id, pobj); pointer_cache_traits<pointer_type>::insert (*this, id, pobj);
return id; return id;
} }
template <typename T> template <typename T>
typename object_traits<T>::pointer_type database:: typename object_traits<T>::pointer_type database::
load (const typename object_traits<T>::id_type& id) load (const typename object_traits<T>::id_type& id)
{ {
typedef typename object_traits<T>::pointer_type pointer_type; typedef typename object_traits<T>::pointer_type pointer_type;
skipping to change at line 135 skipping to change at line 143
update (T& obj) update (T& obj)
{ {
// T can be const T while object_type will always be T. // T can be const T while object_type will always be T.
// //
typedef typename odb::object_traits<T>::object_type object_type; typedef typename odb::object_traits<T>::object_type object_type;
typedef odb::object_traits<object_type> object_traits; typedef odb::object_traits<object_type> object_traits;
if (!transaction::has_current ()) if (!transaction::has_current ())
throw not_in_transaction (); throw not_in_transaction ();
object_traits::callback (*this, obj,callback_event::pre_update);
object_traits::update (*this, obj); object_traits::update (*this, obj);
object_traits::callback (*this, obj, callback_event::post_update);
} }
template <typename T> template <typename T>
void database:: void database::
update_ (const typename object_traits<T>::pointer_type& pobj) update_ (const typename object_traits<T>::pointer_type& pobj)
{ {
// T can be const T while object_type will always be T. // T can be const T while object_type will always be T.
// //
typedef typename odb::object_traits<T>::object_type object_type; typedef typename odb::object_traits<T>::object_type object_type;
typedef odb::object_traits<object_type> object_traits; typedef odb::object_traits<object_type> object_traits;
typedef typename odb::object_traits<T>::pointer_type pointer_type; typedef typename odb::object_traits<T>::pointer_type pointer_type;
typedef odb::pointer_traits<pointer_type> pointer_traits; typedef odb::pointer_traits<pointer_type> pointer_traits;
if (!transaction::has_current ()) if (!transaction::has_current ())
throw not_in_transaction (); throw not_in_transaction ();
object_traits::update (*this, pointer_traits::get_ref (pobj)); T& obj (pointer_traits::get_ref (pobj));
object_traits::callback (*this, obj, callback_event::pre_update);
object_traits::update (*this, obj);
object_traits::callback (*this, obj, callback_event::post_update);
} }
template <typename T> template <typename T>
void database:: void database::
erase (const typename object_traits<T>::id_type& id) erase (const typename object_traits<T>::id_type& id)
{ {
// T can be const T while object_type will always be T. // T can be const T while object_type will always be T.
// //
typedef typename odb::object_traits<T>::object_type object_type; typedef typename odb::object_traits<T>::object_type object_type;
typedef odb::object_traits<object_type> object_traits; typedef odb::object_traits<object_type> object_traits;
skipping to change at line 175 skipping to change at line 189
typedef typename odb::object_traits<T>::pointer_type pointer_type; typedef typename odb::object_traits<T>::pointer_type pointer_type;
if (!transaction::has_current ()) if (!transaction::has_current ())
throw not_in_transaction (); throw not_in_transaction ();
object_traits::erase (*this, id); object_traits::erase (*this, id);
pointer_cache_traits<pointer_type>::erase (*this, id); pointer_cache_traits<pointer_type>::erase (*this, id);
} }
template <typename T> template <typename T>
void database::
erase (T& obj)
{
// T can be const T while object_type will always be T.
//
typedef typename odb::object_traits<T>::object_type object_type;
typedef odb::object_traits<object_type> object_traits;
typedef typename odb::object_traits<T>::pointer_type pointer_type;
if (!transaction::has_current ())
throw not_in_transaction ();
typename object_traits::id_type id (object_traits::id (obj));
object_traits::callback (*this, obj, callback_event::pre_erase);
object_traits::erase (*this, id);
pointer_cache_traits<pointer_type>::erase (*this, id);
object_traits::callback (*this, obj, callback_event::post_erase);
}
template <typename T>
result<T> database:: result<T> database::
query (const odb::query<typename object_traits<T>::object_type>& q, query (const odb::query<typename object_traits<T>::object_type>& q,
bool cache) bool cache)
{ {
// T can be const T while object_type will always be T. // T can be const T while object_type will always be T.
// //
typedef typename odb::object_traits<T>::object_type object_type; typedef typename odb::object_traits<T>::object_type object_type;
typedef odb::object_traits<object_type> object_traits; typedef odb::object_traits<object_type> object_traits;
if (!transaction::has_current ()) if (!transaction::has_current ())
 End of changes. 9 change blocks. 
1 lines changed or deleted 37 lines changed or added


 schema-catalog-impl.hxx   schema-catalog-impl.hxx 
skipping to change at line 38 skipping to change at line 38
schema_catalog_init (); schema_catalog_init ();
~schema_catalog_init (); ~schema_catalog_init ();
}; };
static const schema_catalog_init schema_catalog_init_; static const schema_catalog_init schema_catalog_init_;
// Catalog entry registration. // Catalog entry registration.
// //
struct LIBODB_EXPORT schema_catalog_entry struct LIBODB_EXPORT schema_catalog_entry
{ {
schema_catalog_entry (const char* name, void (*entry) (database&)); schema_catalog_entry (const char* name,
bool (*entry) (database&, unsigned short pass));
}; };
} }
#include <odb/post.hxx> #include <odb/post.hxx>
#endif // ODB_SCHEMA_CATALOG_IMPL_HXX #endif // ODB_SCHEMA_CATALOG_IMPL_HXX
 End of changes. 1 change blocks. 
1 lines changed or deleted 2 lines changed or added


 unused.hxx   unused.hxx 
// file : odb/details/unused.hxx // file : odb/details/unused.hxx
// author : Boris Kolpackov <boris@codesynthesis.com> // author : Boris Kolpackov <boris@codesynthesis.com>
// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
// license : GNU GPL v2; see accompanying LICENSE file // license : GNU GPL v2; see accompanying LICENSE file
#ifndef ODB_UNUSED_DETAILS_HXX #ifndef ODB_UNUSED_DETAILS_HXX
#define ODB_UNUSED_DETAILS_HXX #define ODB_UNUSED_DETAILS_HXX
#include <odb/pre.hxx> #include <odb/pre.hxx>
#define ODB_POTENTIALLY_UNUSED(x) (void)x // VC++ doesn't like the (void)x expression if x is a reference to
// an incomplete type. On the other hand, GCC warns that (void*)&x
// doesn't have any effect.
//
#ifdef _MSC_VER
# define ODB_POTENTIALLY_UNUSED(x) (void*)&x
#else
# define ODB_POTENTIALLY_UNUSED(x) (void)x
#endif
#include <odb/post.hxx> #include <odb/post.hxx>
#endif // ODB_UNUSED_DETAILS_HXX #endif // ODB_UNUSED_DETAILS_HXX
 End of changes. 1 change blocks. 
1 lines changed or deleted 9 lines changed or added


 version.hxx   version.hxx 
skipping to change at line 30 skipping to change at line 30
// Version AABBCCDD // Version AABBCCDD
// 2.0.0 02000000 // 2.0.0 02000000
// 2.1.0 02010000 // 2.1.0 02010000
// 2.1.1 02010100 // 2.1.1 02010100
// 2.2.0.a1 02019901 // 2.2.0.a1 02019901
// 3.0.0.b2 02999952 // 3.0.0.b2 02999952
// //
// ODB interface version: minor, major, and alpha/beta versions. // ODB interface version: minor, major, and alpha/beta versions.
// //
#define ODB_VERSION 10400 #define ODB_VERSION 10500
#define ODB_VERSION_STR "1.4" #define ODB_VERSION_STR "1.5"
// libodb version: interface version plus the bugfix version. // libodb version: interface version plus the bugfix version.
// //
#define LIBODB_VERSION 1040000 #define LIBODB_VERSION 1050000
#define LIBODB_VERSION_STR "1.4.0" #define LIBODB_VERSION_STR "1.5.0"
#include <odb/post.hxx> #include <odb/post.hxx>
#endif // ODB_VERSION_HXX #endif // ODB_VERSION_HXX
 End of changes. 2 change blocks. 
4 lines changed or deleted 4 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/