diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Winamp/ServiceManager.h | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/Winamp/ServiceManager.h')
-rw-r--r-- | Src/Winamp/ServiceManager.h | 47 |
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 |