SOCI Logo Get SOCI at SourceForge.net. Fast, secure and Free Open Source software downloads

once-temp-type.cpp

Go to the documentation of this file.
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 "once-temp-type.h"
00010 #include "ref-counted-statement.h"
00011 #include "session.h"
00012 
00013 using namespace soci;
00014 using namespace soci::details;
00015 
00016 once_temp_type::once_temp_type(session & s)
00017     : rcst_(new ref_counted_statement(s))
00018 {
00019     // this is the beginning of new query
00020     s.get_query_stream().str("");
00021 }
00022 
00023 once_temp_type::once_temp_type(once_temp_type const & o)
00024     :rcst_(o.rcst_)
00025 {
00026     rcst_->inc_ref();
00027 }
00028 
00029 once_temp_type & once_temp_type::operator=(once_temp_type const & o)
00030 {
00031     o.rcst_->inc_ref();
00032     rcst_->dec_ref();
00033     rcst_ = o.rcst_;
00034 
00035     return *this;
00036 }
00037 
00038 once_temp_type::~once_temp_type()
00039 {
00040     rcst_->dec_ref();
00041 }
00042 
00043 once_temp_type & once_temp_type::operator,(into_type_ptr const & i)
00044 {
00045     rcst_->exchange(i);
00046     return *this;
00047 }
00048 
00049 once_temp_type & once_temp_type::operator,(use_type_ptr const & u)
00050 {
00051     rcst_->exchange(u);
00052     return *this;
00053 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
SourceForge Logo

Generated on Sun Oct 3 2010 17:42:17 for EXTRAS-SOCI by Doxygen 1.7.1