00001 // 00002 // Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton 00003 // Distributed under the Boost Software License, Version 1.0. 00004 // (See accompanying file LICENSE_1_0.txt or copy at 00005 // http://www.boost.org/LICENSE_1_0.txt) 00006 // 00007 00008 #define SOCI_SOURCE 00009 #include "ref-counted-prepare-info.h" 00010 #include "session.h" 00011 00012 using namespace soci; 00013 using namespace soci::details; 00014 00015 void ref_counted_prepare_info::exchange(into_type_ptr const & i) 00016 { 00017 intos_.push_back(i.get()); 00018 i.release(); 00019 } 00020 00021 void ref_counted_prepare_info::exchange(use_type_ptr const & u) 00022 { 00023 uses_.push_back(u.get()); 00024 u.release(); 00025 } 00026 00027 void ref_counted_prepare_info::final_action() 00028 { 00029 // deallocate all bind and define objects 00030 for (std::size_t i = intos_.size(); i > 0; --i) 00031 { 00032 delete intos_[i - 1]; 00033 intos_.resize(i - 1); 00034 } 00035 00036 for (std::size_t i = uses_.size(); i > 0; --i) 00037 { 00038 delete uses_[i - 1]; 00039 uses_.resize(i - 1); 00040 } 00041 } 00042 00043 std::string ref_counted_prepare_info::get_query() const 00044 { 00045 return session_.get_query_stream().str(); 00046 }
Generated on Sun Oct 3 2010 17:42:17 for EXTRAS-SOCI by Doxygen 1.7.1