// file : odb/lazy-pointer-traits.hxx // author : Boris Kolpackov // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ODB_LAZY_POINTER_TRAITS_HXX #define ODB_LAZY_POINTER_TRAITS_HXX #include #include #include namespace odb { template class pointer_traits< lazy_ptr > { public: static pointer_kind const kind = pk_raw; static bool const lazy = true; typedef T element_type; typedef lazy_ptr pointer_type; typedef element_type* eager_pointer_type; static bool null_ptr (const pointer_type& p) { return !p; } template static typename object_traits::id_type object_id (const pointer_type& p) { return p.object_id (); } }; template class pointer_traits< lazy_auto_ptr > { public: static pointer_kind const kind = pk_unique; static bool const lazy = true; typedef T element_type; typedef lazy_auto_ptr pointer_type; typedef std::auto_ptr eager_pointer_type; static bool null_ptr (const pointer_type& p) { return !p; } template static typename object_traits::id_type object_id (const pointer_type& p) { return p.object_id (); } }; } #include #endif // ODB_LAZY_POINTER_TRAITS_HXX