@@ -21,7 +21,7 @@ static int64_t now() {
2121}
2222
2323namespace postgres_asio {
24- inline static boost ::shared_ptr<PGresult> make_shared (PGresult* p) { return boost ::shared_ptr<PGresult>(p, PQclear); }
24+ inline static std ::shared_ptr<PGresult> make_shared (PGresult* p) { return std ::shared_ptr<PGresult>(p, PQclear); }
2525
2626 connection::connection (boost::asio::io_service& fg, boost::asio::io_service& bg, std::string trace_id) :
2727 _fg_ios (fg),
@@ -85,7 +85,7 @@ namespace postgres_asio {
8585 }
8686
8787 // connect syncrounous and run callcack from fg thread event loop
88- void connection::_bg_connect (boost ::shared_ptr<connection> self, std::string connect_string, on_connect_callback cb) {
88+ void connection::_bg_connect (std ::shared_ptr<connection> self, std::string connect_string, on_connect_callback cb) {
8989 _start_ts = now ();
9090 _pg_conn = PQconnectdb (connect_string.c_str ());
9191 auto status = PQstatus (_pg_conn); //
@@ -119,18 +119,18 @@ namespace postgres_asio {
119119 }
120120
121121
122- std::pair<int , boost ::shared_ptr<PGresult>> connection::exec (std::string statement) {
123- std::promise<std::pair<int , boost ::shared_ptr<PGresult>>> p;
124- std::future<std::pair<int , boost ::shared_ptr<PGresult>>> f = p.get_future ();
125- exec (statement, [&p](int ec, boost ::shared_ptr<PGresult> res) {
126- std::pair<int , boost ::shared_ptr<PGresult>> val (ec, res);
122+ std::pair<int , std ::shared_ptr<PGresult>> connection::exec (std::string statement) {
123+ std::promise<std::pair<int , std ::shared_ptr<PGresult>>> p;
124+ std::future<std::pair<int , std ::shared_ptr<PGresult>>> f = p.get_future ();
125+ exec (statement, [&p](int ec, std ::shared_ptr<PGresult> res) {
126+ std::pair<int , std ::shared_ptr<PGresult>> val (ec, res);
127127 p.set_value (val);
128128 });
129129 f.wait ();
130130 return f.get ();
131131 }
132132
133- void connection::_fg_socket_rx_cb (const boost::system::error_code& ec, boost ::shared_ptr<connection> self, on_query_callback cb) {
133+ void connection::_fg_socket_rx_cb (const boost::system::error_code& ec, std ::shared_ptr<connection> self, on_query_callback cb) {
134134 BOOST_LOG_TRIVIAL (trace) << _trace_id << " , " << BOOST_CURRENT_FUNCTION;
135135 if (ec) {
136136 BOOST_LOG_TRIVIAL (warning) << _trace_id << " , postgres::exec asio ec:" << ec.message ();
@@ -162,7 +162,6 @@ namespace postgres_asio {
162162 _results.push_back (r);
163163 }
164164
165-
166165 int32_t duration = (int32_t ) (now () - _start_ts);
167166
168167 // if we got a NULL here then we are ready to issue another async exec....
@@ -173,7 +172,7 @@ namespace postgres_asio {
173172 return ;
174173 }
175174
176- boost ::shared_ptr<PGresult> last_result = *_results.rbegin ();
175+ std ::shared_ptr<PGresult> last_result = *_results.rbegin ();
177176 _results.clear ();
178177
179178 int status = PQresultStatus (last_result.get ());
@@ -210,9 +209,9 @@ namespace postgres_asio {
210209 // }
211210
212211 // //TBD reuse connections.
213- // boost ::shared_ptr<postgres_asio::connection> connection_pool::create()
212+ // std ::shared_ptr<postgres_asio::connection> connection_pool::create()
214213 // {
215- // return boost ::make_shared<postgres_asio::connection>(_fg_ios, _bg_ios);
214+ // return std ::make_shared<postgres_asio::connection>(_fg_ios, _bg_ios);
216215 // }
217216 //
218217 // // TBD
0 commit comments