aboutsummaryrefslogtreecommitdiff
path: root/lib/service/service.h
blob: f32e23d9d1ddcad8e012a1fc1cfea24b997cc71f (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
#ifndef __service_h
#define __service_h

#include <map>
#include <lib/base/object.h>
#include <lib/service/iservice.h>

class eServiceCenter: public virtual iServiceHandler, public virtual iObject
{
DECLARE_REF;
private:
	std::map<int,ePtr<iServiceHandler> > handler;
	static eServiceCenter *instance;
public:
	eServiceCenter();
	virtual ~eServiceCenter();

		// iServiceHandler
	RESULT play(const eServiceReference &, ePtr<iPlayableService> &ptr);
	RESULT record(const eServiceReference &, ePtr<iRecordableService> &ptr);
	RESULT list(const eServiceReference &, ePtr<iListableService> &ptr);
	
		// eServiceCenter
	static RESULT getInstance(ePtr<eServiceCenter> &ptr) { ptr = instance; return 0; }
	RESULT addServiceFactory(int id, iServiceHandler *hnd);
	RESULT removeServiceFactory(int id);
};

#endif