aboutsummaryrefslogtreecommitdiff
path: root/Src/Winamp/ServiceManager.h
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
committerJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Winamp/ServiceManager.h
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/Winamp/ServiceManager.h')
-rw-r--r--Src/Winamp/ServiceManager.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/Src/Winamp/ServiceManager.h b/Src/Winamp/ServiceManager.h
new file mode 100644
index 00000000..b8facf35
--- /dev/null
+++ b/Src/Winamp/ServiceManager.h
@@ -0,0 +1,47 @@
+#ifndef NULLSOFT_SERVICEMANAGERH
+#define NULLSOFT_SERVICEMANAGERH
+
+#include <api/service/api_service.h>
+#include "../nu/AutoLock.h"
+#include <vector>
+#include <map>
+
+struct Counter;
+
+class ServiceManager : public api_service
+{
+public:
+ ServiceManager();
+
+ int service_register( waServiceFactory *svc );
+ int service_deregister( waServiceFactory *svc );
+
+ size_t service_getNumServices( FOURCC svc_type );
+
+ waServiceFactory *service_enumService( FOURCC svc_type, size_t n );
+ waServiceFactory *service_getServiceByGuid( GUID guid );
+
+ int service_lock( waServiceFactory *owner, void *svcptr );
+ int service_clientLock( void *svcptr );
+ int service_release( void *svcptr );
+
+ const char *service_getTypeName( FOURCC svc_type );
+
+ int service_unlock( void *svcptr );
+ int service_isvalid( FOURCC svctype, waServiceFactory *service );
+ int service_compactDuplicates( waServiceFactory *me );
+
+protected:
+ RECVS_DISPATCH;
+
+private:
+ Nullsoft::Utility::LockGuard serviceGuard;
+ typedef std::vector<waServiceFactory *> ServiceList;
+ ServiceList services;
+ std::vector<Counter *> locks;
+ std::map<FOURCC, ServiceList *> services_by_type;
+};
+
+extern api_service *serviceManager;
+
+#endif \ No newline at end of file