--- parser3/src/include/pa_sql_connection.h 2003/01/27 17:17:06 1.30.2.3 +++ parser3/src/include/pa_sql_connection.h 2003/03/20 08:11:13 1.30.2.7.2.2 @@ -1,16 +1,16 @@ /** @file Parser: sql fconnection decl. - Copyright (c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_SQL_CONNECTION_H #define PA_SQL_CONNECTION_H -static const char* IDENT_SQL_CONNECTION_H="$Date: 2003/01/27 17:17:06 $"; +static const char* IDENT_SQL_CONNECTION_H="$Date: 2003/03/20 08:11:13 $"; + -#include "pa_pool.h" #include "pa_sql_driver.h" #include "pa_sql_driver_manager.h" @@ -30,11 +30,11 @@ static const char* IDENT_SQL_CONNECTION_ /// SQL_Driver_services Pooled implementation class SQL_Driver_services_impl: public SQL_Driver_services { Pool *fpool; - ConstStringPtr furl; + const String& furl; Exception fexception; public: SQL_Driver_services_impl(): fpool(0), furl(0) {} - void set_pool_and_url(Pool *apool, ConstStringPtr aurl) { fpool=apool; furl=aurl;} + void set_pool_and_url(Pool *const String& aurl) { fpool=apool; furl=aurl;} override void *malloc(size_t size) { return fpool->malloc(size); } override void *calloc(size_t size) { return fpool->calloc(size); } @@ -73,12 +73,12 @@ public: } private: - ConstStringPtr url_without_login() const; + const String& url_without_login() const; }; /// SQL connection. handy wrapper around low level SQL_Driver class SQL_Connection: public PA_Object { - ConstStringPtr furl; + const String& furl; SQL_Driver& fdriver; SQL_Driver_services_impl fservices; void *fconnection; @@ -87,7 +87,7 @@ class SQL_Connection: public PA_Object { public: - SQL_Connection(ConstStringPtr aurl, SQL_Driver& adriver): + SQL_Connection(const String& aurl, SQL_Driver& adriver): furl(aurl), fdriver(adriver), fconnection(0), @@ -95,10 +95,10 @@ public: marked_to_rollback(false) { } - ConstStringPtr get_url() { return furl; } + const String& get_url() { return furl; } - void set_pool(Pool *pool) { - fservices.set_pool_and_url(pool, pool?furl:ConstStringPtrZero); + void set_pool() { + fservices.set_pool_and_url(pool?furl:0); } bool expired(time_t older_dies) { return /*!freferences && */time_used