VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
ServiceExchange.cpp
Go to the documentation of this file.
2#include <string>
3
4namespace VoltMod
5{
6
7Subscription ServiceExchange::PublishNamed(std::string_view iface, void* impl)
8{
9 _services.Publish(iface, impl);
10 return Subscription([&services = _services, name = std::string(iface)] { services.Unpublish(name); });
11}
12
13void* ServiceExchange::Find(std::string_view iface) const
14{
15 return _services.Find(iface);
16}
17
18} // namespace VoltMod
static std::string ReadFile(const std::filesystem::path &path)
Definition Loader.cpp:56
virtual void * Find(std::string_view name)=0
virtual void Publish(std::string_view name, void *implementation)=0