diff options
author | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
---|---|---|
committer | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
commit | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/replicant/nswasabi/ComponentManagerBase.h | |
parent | 537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff) | |
download | winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz |
Initial community commit
Diffstat (limited to 'Src/replicant/nswasabi/ComponentManagerBase.h')
-rw-r--r-- | Src/replicant/nswasabi/ComponentManagerBase.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Src/replicant/nswasabi/ComponentManagerBase.h b/Src/replicant/nswasabi/ComponentManagerBase.h new file mode 100644 index 00000000..00252b36 --- /dev/null +++ b/Src/replicant/nswasabi/ComponentManagerBase.h @@ -0,0 +1,31 @@ +#pragma once +#include "nx/nxuri.h" +#include "service/api_service.h" +#include "component/ifc_component.h" +#include "nu/PtrDeque.h" +#include "component/ifc_component_sync.h" + +class ComponentManagerBase +{ +public: + void SetServiceAPI(api_service *service_api); + int Load(); +protected: + ComponentManagerBase(); + int LateLoad(ifc_component *mod); + enum Phase + { + PHASE_INITIALIZE=0, /* components are still being added */ + PHASE_REGISTERED=1, /* RegisterServices() has been called on all components */ + PHASE_LOADING=2, /* OnLoading() has been called on all components */ + PHASE_LOADED=3, /* OnLoaded() has been called on all components */ + }; + Phase phase; + typedef nu::PtrDeque<ifc_component> ComponentList; + ComponentList components; + api_service *service_api; + ifc_component_sync *component_sync; +private: + /* your implementation needs to override this. You should call FreeLibrary(component->component_info.hModule); or dlclose(component->component_info.dl_handle); or similar */ + virtual void CloseComponent(ifc_component *component)=0; +}; |