// file : odb/database.hxx // author : Boris Kolpackov // copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file #ifndef ODB_DATABASE_HXX #define ODB_DATABASE_HXX #include #include #include #include #include #include #include namespace odb { class transaction_impl; class LIBODB_EXPORT database { public: virtual ~database (); // Object persistence API. // public: // Make the object persistent. // template typename object_traits::id_type persist (T& object); // Throw object_not_persistent if not found. // template typename object_traits::pointer_type load (const typename object_traits::id_type& id); template void load (const typename object_traits::id_type& id, T& object); // Return NULL/false if not found. // template typename object_traits::pointer_type find (const typename object_traits::id_type& id); template bool find (const typename object_traits::id_type& id, T& object); // Save the state of a modified objects. // template void store (T& object); // Make the object transient. Throw object_not_persistent if not // found. // template void erase (const T& object); template void erase (const typename object_traits::id_type& id); // Object query API. // template result query (); template result query (const std::string&); template result query (const odb::query&); // Transaction API. // public: virtual transaction_impl* begin_transaction () = 0; protected: database (); private: database (const database&); database& operator= (const database&); }; } #include #include #include #endif // ODB_DATABASE_HXX