diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2024-01-25 17:28:38 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2024-01-25 17:28:38 +0300 |
commit | d9f372d7b1bc1abbff5fdf9735118290cd024d5e (patch) | |
tree | 49bc3160ea184e19cd5cb6a7404dee42311c0fd7 /odb/pgsql/statement-cache.txx | |
parent | 55e14d8f9697adeeb05fcd23cf8f19c33452bb56 (diff) |
Turn libodb-pgsql repository into package for muti-package repositorylibodb-pgsql
Diffstat (limited to 'odb/pgsql/statement-cache.txx')
-rw-r--r-- | odb/pgsql/statement-cache.txx | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/odb/pgsql/statement-cache.txx b/odb/pgsql/statement-cache.txx deleted file mode 100644 index 488ba2c..0000000 --- a/odb/pgsql/statement-cache.txx +++ /dev/null @@ -1,60 +0,0 @@ -// file : odb/pgsql/statement-cache.txx -// license : GNU GPL v2; see accompanying LICENSE file - -#include <odb/pgsql/database.hxx> - -namespace odb -{ - namespace pgsql - { - template <typename T> - typename object_traits_impl<T, id_pgsql>::statements_type& - statement_cache:: - find_object () - { - typedef - typename object_traits_impl<T, id_pgsql>::statements_type - statements_type; - - // Clear the cache if the database version has changed. This - // makes sure we don't re-use statements that correspond to - // the old schema. - // - if (version_seq_ != conn_.database ().schema_version_sequence ()) - { - map_.clear (); - version_seq_ = conn_.database ().schema_version_sequence (); - } - - map::iterator i (map_.find (&typeid (T))); - - if (i != map_.end ()) - return static_cast<statements_type&> (*i->second); - - details::shared_ptr<statements_type> p ( - new (details::shared) statements_type (conn_)); - - map_.insert (map::value_type (&typeid (T), p)); - return *p; - } - - template <typename T> - view_statements<T>& statement_cache:: - find_view () - { - // We don't cache any statements for views so no need to clear - // the cache. - - map::iterator i (map_.find (&typeid (T))); - - if (i != map_.end ()) - return static_cast<view_statements<T>&> (*i->second); - - details::shared_ptr<view_statements<T> > p ( - new (details::shared) view_statements<T> (conn_)); - - map_.insert (map::value_type (&typeid (T), p)); - return *p; - } - } -} |