summaryrefslogtreecommitdiff
path: root/p2pvr/lib/dbClient.h
blob: aef2bf2ab517b6be633c2da39e5cb68b6273dee0 (plain)
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
#ifndef DBCLIENT_H
#define DBCLIENT_H

#include <commonObjects.h>
#include <variableType.h>
#include <list>
#include <selectcommand.h>
#include <scopeObject.h>

class DatabaseClient : public virtual CommonObjects {
	public:
		typedef boost::shared_ptr<DB::SelectCommand> SelectPtr;
	protected:
		class TxHelper {
			public:
				TxHelper(const DatabaseClient *);
			private:
				ScopeObject so;
		};

		SelectPtr Select(const std::string &) const;
		SelectPtr Select(const std::string &, const std::list<VariableType> &) const;

	private:
		friend class TxHelper;
		typedef boost::function<void(DataSourcePtr)> DataSourceCall;
		void onAllDatasources(const DataSourceCall &) const;
};

#endif