tape_ODBC/ODBCConnMgr.h

00001 /*  ODBCConnMgr.h
00002  *  A singleton class used to track each of the databases that the
00003  *      ODBCTapeStream objects are connecting to.  Provides both
00004  *      dictionary and observer functionality for ODBC connections.
00005  *  The dictionary ops allow re-use of an existing connection.
00006  *  The observer routines will hypothetically clean the objects and
00007  *      gracefully kill the app if a database connection is lost when
00008  *      I/O is needed.
00009  *  author: Matt Hauer, matthew.hauer@pnl.gov, 6/4/07 - ***
00010  */
00011 
00012 #ifndef _ODBCCONNMGR_H_
00013 #define _ODBCCONNMGR_H_
00014 
00015 #include <list>
00016 
00017 #include "ODBCConnHandle.h"
00018 
00019 using namespace std;
00020 
00021 class ODBCConnHandle;
00022 
00023 class ODBCConnMgr{
00024 public:
00025     ~ODBCConnMgr();
00026 
00027     ODBCConnHandle *ConnectToHost(char *, char *, char *);
00028     int DisconnectFromHost(char *);
00029     static ODBCConnMgr *GetMgr();
00030 private:
00031     ODBCConnMgr();
00032 
00033     list<ODBCConnHandle *>  handles;
00034     static ODBCConnMgr *mgr;
00035 };
00036 
00037 #endif

GridLAB-DTM Version 1.0
An open-source project initiated by the US Department of Energy