2025-01-08 06:26:36 -04:00
|
|
|
#ifndef SENSE_API_MANAGER_H
|
|
|
|
|
#define SENSE_API_MANAGER_H
|
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
#include <memory>
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <optional>
|
|
|
|
|
#include <functional>
|
2025-01-08 11:49:28 -04:00
|
|
|
#include <senseApis/senseApiLib.h>
|
2025-01-08 06:26:36 -04:00
|
|
|
|
2025-01-08 11:49:28 -04:00
|
|
|
namespace hk {
|
|
|
|
|
namespace sense_api {
|
2025-01-08 06:26:36 -04:00
|
|
|
|
|
|
|
|
class SenseApiManager {
|
|
|
|
|
public:
|
|
|
|
|
static SenseApiManager& getInstance()
|
|
|
|
|
{
|
2025-01-08 11:49:28 -04:00
|
|
|
static SenseApiManager instance;
|
2025-01-08 06:26:36 -04:00
|
|
|
return instance;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SenseApiLib& loadSenseApiLib(const std::string& libraryPath);
|
|
|
|
|
std::optional<std::reference_wrapper<SenseApiLib>> getSenseApiLib(
|
|
|
|
|
const std::string& libraryPath);
|
|
|
|
|
void unloadSenseApiLib(const std::string& libraryPath);
|
2025-01-08 15:06:31 -04:00
|
|
|
void loadAllSenseApiLibsFromOptions(void);
|
2025-01-08 06:26:36 -04:00
|
|
|
|
|
|
|
|
private:
|
2025-01-08 11:49:28 -04:00
|
|
|
SenseApiManager() = default;
|
2025-01-08 06:26:36 -04:00
|
|
|
~SenseApiManager() = default;
|
|
|
|
|
|
|
|
|
|
SenseApiManager(const SenseApiManager&) = delete;
|
|
|
|
|
SenseApiManager& operator=(const SenseApiManager&) = delete;
|
|
|
|
|
|
|
|
|
|
std::vector<std::unique_ptr<SenseApiLib>> senseApiLibs;
|
|
|
|
|
};
|
|
|
|
|
|
2025-01-08 11:49:28 -04:00
|
|
|
} // namespace sense_api
|
|
|
|
|
} // namespace hk
|
|
|
|
|
|
2025-01-08 06:26:36 -04:00
|
|
|
#endif // SENSE_API_MANAGER_H
|