/usr/include/cppdb/conn_manager.h is in libcppdb-dev 0.3.1+dfsg-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | ///////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2010-2011 Artyom Beilis (Tonkikh) <artyomtnk@yahoo.com>
//
// Distributed under:
//
// the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// or (at your opinion) under:
//
// The MIT License
// (See accompanying file MIT.txt or a copy at
// http://www.opensource.org/licenses/mit-license.php)
//
///////////////////////////////////////////////////////////////////////////////
#ifndef CPPDB_CONN_MANAGER_H
#define CPPDB_CONN_MANAGER_H
#include <cppdb/defs.h>
#include <cppdb/ref_ptr.h>
#include <cppdb/mutex.h>
#include <map>
#include <string>
#include <memory>
namespace cppdb {
class pool;
class connection_info;
namespace backend {
class connection;
}
///
/// \brief This class is the major gateway to new connections
///
/// It handles connection pools and forwards request to the drivers.
///
/// This class member functions are thread safe
///
class CPPDB_API connections_manager {
connections_manager();
// Borland erros on hidden destructors in classes without only static methods.
#ifndef __BORLANDC__
~connections_manager();
#endif
connections_manager(connections_manager const &);
void operator = (connections_manager const &);
public:
///
/// Get a singleton instance of the class
///
static connections_manager &instance();
///
/// Create a new connection using connection string \a cs
///
ref_ptr<backend::connection> open(std::string const &cs);
///
/// Create a new connection using parsed connection string \a ci
///
ref_ptr<backend::connection> open(connection_info const &ci);
///
/// Collect all connections that were not used for long time and close them.
///
void gc();
private:
struct data;
std::auto_ptr<data> d;
mutex lock_;
typedef std::map<std::string,ref_ptr<pool> > connections_type;
connections_type connections_;
};
} // cppdb
#endif
|