~mysql/mysql-connector-cpp/trunk

« back to all changes in this revision

Viewing changes to driver/mysql_connection.cpp

  • Committer: Hemant Dangi
  • Date: 2014-12-17 16:28:39 UTC
  • Revision ID: hemant.dangi@oracle.com-20141217162839-sdbpj3fcwn5gxjxh
Bug #75251: Add C++11 support and replace (deprecated in C++11) auto_ptr

Show diffs side-by-side

added added

removed removed

Lines of Context:
119
119
 
120
120
/* {{{ MySQL_Connection::MySQL_Connection() -I- */
121
121
MySQL_Connection::MySQL_Connection(Driver * _driver,
122
 
                                                                   ::sql::mysql::NativeAPI::NativeConnectionWrapper& _proxy,
123
 
                                                                   const sql::SQLString& hostName,
124
 
                                                                   const sql::SQLString& userName,
125
 
                                                                   const sql::SQLString& password)
126
 
        :       driver  (_driver),
127
 
                proxy   (&_proxy),
128
 
                intern  (NULL)
 
122
                                   ::sql::mysql::NativeAPI::NativeConnectionWrapper& _proxy,
 
123
                                   const sql::SQLString& hostName,
 
124
                                   const sql::SQLString& userName,
 
125
                                   const sql::SQLString& password)
 
126
                                   :  driver (_driver),
 
127
                                      proxy  (&_proxy),
 
128
                                      intern (NULL)
129
129
{
130
130
        sql::ConnectOptionsMap connection_properties;
131
131
        connection_properties["hostName"] = hostName;
133
133
        connection_properties["password"] = password;
134
134
 
135
135
        boost::shared_ptr< MySQL_DebugLogger > tmp_logger(new MySQL_DebugLogger());
136
 
        std::auto_ptr< MySQL_ConnectionData > tmp_intern(new MySQL_ConnectionData(tmp_logger));
137
 
        intern = tmp_intern.get();
 
136
        intern.reset(new MySQL_ConnectionData(tmp_logger));
138
137
 
139
138
        service.reset(createServiceStmt());
140
 
 
141
139
        init(connection_properties);
142
 
        // No exception so far, thus intern can still point to the MySQL_ConnectionData object
143
 
        // and in the dtor we will clean it up
144
 
        tmp_intern.release();
145
140
}
146
141
/* }}} */
147
142
 
153
148
        : driver(_driver), proxy(&_proxy), intern(NULL)
154
149
{
155
150
        boost::shared_ptr<MySQL_DebugLogger> tmp_logger(new MySQL_DebugLogger());
156
 
        std::auto_ptr< MySQL_ConnectionData > tmp_intern(new MySQL_ConnectionData(tmp_logger));
157
 
        intern = tmp_intern.get();
 
151
        intern.reset(new MySQL_ConnectionData(tmp_logger));
158
152
 
159
153
        service.reset(createServiceStmt());
160
 
 
161
154
        init(properties);
162
 
        // No exception so far, thus intern can still point to the MySQL_ConnectionData object
163
 
        // and in the dtor we will clean it up
164
 
        tmp_intern.release();
165
155
}
166
156
/* }}} */
167
157
 
178
168
        {
179
169
                CPP_ENTER_WL(intern->logger, "MySQL_Connection::~MySQL_Connection");
180
170
        }
181
 
 
182
 
        delete intern;
183
171
}
184
172
/* }}} */
185
173