some cleanup
[enigma2.git] / lib / service / service.h
1 #ifndef __service_h
2 #define __service_h
3
4 #include <map>
5 #include <lib/base/object.h>
6 #include <lib/service/iservice.h>
7
8 class eServiceCenter: public virtual iServiceHandler, public virtual iObject
9 {
10 DECLARE_REF;
11 private:
12         std::map<int,ePtr<iServiceHandler> > handler;
13         static eServiceCenter *instance;
14 public:
15         eServiceCenter();
16         virtual ~eServiceCenter();
17
18                 // iServiceHandler
19         RESULT play(const eServiceReference &, ePtr<iPlayableService> &ptr);
20         RESULT record(const eServiceReference &, ePtr<iRecordableService> &ptr);
21         RESULT list(const eServiceReference &, ePtr<iListableService> &ptr);
22         
23                 // eServiceCenter
24         static RESULT getInstance(ePtr<eServiceCenter> &ptr) { ptr = instance; return 0; }
25         RESULT addServiceFactory(int id, iServiceHandler *hnd);
26         RESULT removeServiceFactory(int id);
27 };
28
29 #endif