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 "use-type.h" 00010 #include "statement.h" 00011 00012 using namespace soci; 00013 using namespace soci::details; 00014 00015 standard_use_type::~standard_use_type() 00016 { 00017 delete backEnd_; 00018 } 00019 00020 void standard_use_type::bind(statement_impl & st, int & position) 00021 { 00022 backEnd_ = st.make_use_type_backend(); 00023 if (name_.empty()) 00024 { 00025 backEnd_->bind_by_pos(position, data_, type_, readOnly_); 00026 } 00027 else 00028 { 00029 backEnd_->bind_by_name(name_, data_, type_, readOnly_); 00030 } 00031 } 00032 00033 void standard_use_type::pre_use() 00034 { 00035 convert_to_base(); 00036 backEnd_->pre_use(ind_); 00037 } 00038 00039 void standard_use_type::post_use(bool gotData) 00040 { 00041 backEnd_->post_use(gotData, ind_); 00042 convert_from_base(); 00043 } 00044 00045 void standard_use_type::clean_up() 00046 { 00047 if (backEnd_ != NULL) 00048 { 00049 backEnd_->clean_up(); 00050 } 00051 } 00052 00053 vector_use_type::~vector_use_type() 00054 { 00055 delete backEnd_; 00056 } 00057 00058 void vector_use_type::bind(statement_impl & st, int & position) 00059 { 00060 backEnd_ = st.make_vector_use_type_backend(); 00061 if (name_.empty()) 00062 { 00063 backEnd_->bind_by_pos(position, data_, type_); 00064 } 00065 else 00066 { 00067 backEnd_->bind_by_name(name_, data_, type_); 00068 } 00069 } 00070 00071 void vector_use_type::pre_use() 00072 { 00073 convert_to_base(); 00074 00075 backEnd_->pre_use(ind_ ? &ind_->at(0) : NULL); 00076 } 00077 00078 std::size_t vector_use_type::size() const 00079 { 00080 return backEnd_->size(); 00081 } 00082 00083 void vector_use_type::clean_up() 00084 { 00085 if (backEnd_ != NULL) 00086 { 00087 backEnd_->clean_up(); 00088 } 00089 }
Generated on Sun Oct 3 2010 17:42:17 for EXTRAS-SOCI by Doxygen 1.7.1