+ RESULT flush();
+
+ RESULT startQuery(ePtr<iDVBChannelListQuery> &query, eDVBChannelQuery *q, const eServiceReference &source);
+
+ RESULT getBouquet(const eServiceReference &ref, eBouquet* &bouquet);
+//////
+ void loadBouquet(const char *path);
+ eServiceReference searchReference(int tsid, int onid, int sid);
+ eDVBDB();
+ virtual ~eDVBDB();
+#endif
+ void loadServicelist(const char *filename);
+ static eDVBDB *getInstance() { return instance; }
+ void reloadServicelist();
+ void saveServicelist();
+ void saveServicelist(const char *file);
+ void reloadBouquets();
+ void parseServiceData(ePtr<eDVBService> s, std::string str);
+};
+
+#ifndef SWIG
+ // we have to add a possibility to invalidate here.
+class eDVBDBQueryBase: public iDVBChannelListQuery
+{
+ DECLARE_REF(eDVBDBQueryBase);
+protected:
+ ePtr<eDVBDB> m_db;
+ ePtr<eDVBChannelQuery> m_query;
+ eServiceReference m_source;
+public:
+ eDVBDBQueryBase(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);
+ virtual int compareLessEqual(const eServiceReferenceDVB &a, const eServiceReferenceDVB &b);
+};
+
+class eDVBDBQuery: public eDVBDBQueryBase
+{
+ std::map<eServiceReferenceDVB, ePtr<eDVBService> >::iterator m_cursor;
+public:
+ eDVBDBQuery(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);
+ RESULT getNextResult(eServiceReferenceDVB &ref);
+};
+
+class eDVBDBBouquetQuery: public eDVBDBQueryBase
+{
+ std::list<eServiceReference>::iterator m_cursor;
+public:
+ eDVBDBBouquetQuery(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);
+ RESULT getNextResult(eServiceReferenceDVB &ref);
+};
+
+class eDVBDBListQuery: public eDVBDBQueryBase
+{
+protected:
+ std::list<eServiceReferenceDVB> m_list;
+ std::list<eServiceReferenceDVB>::iterator m_cursor;
+public:
+ eDVBDBListQuery(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);
+ RESULT getNextResult(eServiceReferenceDVB &ref);
+ int compareLessEqual(const eServiceReferenceDVB &a, const eServiceReferenceDVB &b);
+};
+
+class eDVBDBSatellitesQuery: public eDVBDBListQuery
+{
+public:
+ eDVBDBSatellitesQuery(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);
+};
+
+class eDVBDBProvidersQuery: public eDVBDBListQuery
+{
+public:
+ eDVBDBProvidersQuery(eDVBDB *db, const eServiceReference &source, eDVBChannelQuery *query);