# ConnectionManager Class Reference

Connection manager. More...

`#include <ConnectionManager.h>`

List of all members.

## Public Member Functions
| ConnectionManager (const std::string &connInfo, WinLogger *logger, bool autoReconnect=true)
| Constructor.
PGconn * | getConnection ()
| Establishes a connection.
void | setAutoReconnect (bool value)
| Switch Connection Manager to wotk in auto reconnect way.
const bool | isConnected ()
| Checks if connection is established.

## Detailed Description

Connection manager.

Establishes a connection to postgresql DB

## Constructor & Destructor Documentation

ConnectionManager::ConnectionManager | ( | const std::string & | connInfo,
|  | WinLogger * | logger,
|  | bool | autoReconnect = `true` |
| ) |  |  | `[inline]`

Constructor.

Parameters:

  | connInfo | connection info
  | logger | logger

## Member Function Documentation

PGconn * ConnectionManager::getConnection | ( |  | ) |

Establishes a connection.

If a connection was established early it returns old connection if the connection lost it try to established new connection

void ConnectionManager::setAutoReconnect | ( | bool | value | ) | `[inline]`

Switch Connection Manager to wotk in auto reconnect way.

If the option set to true a connection is re-establishing autmatically otherwise a broken connection exception is broken.

const bool ConnectionManager::isConnected | ( |  | ) | `[inline]`

Checks if connection is established.

Returns:
  true in the success

The documentation for this class was generated from the following files:

- C:/Projects/SmartDB/Internals/SmartDB_PQTypes_Lib.v.2.1/SmartDB_PQTypes_Lib/ConnectionManager.h
- C:/Projects/SmartDB/Internals/SmartDB_PQTypes_Lib.v.2.1/SmartDB_PQTypes_Lib/ConnectionManager.cpp