61 lines
1.6 KiB
C++
61 lines
1.6 KiB
C++
#ifndef SENSE_API_MANAGER_H
|
|
#define SENSE_API_MANAGER_H
|
|
|
|
#include <config.h>
|
|
#include <memory>
|
|
#include <vector>
|
|
#include <string>
|
|
#include <optional>
|
|
#include <functional>
|
|
#include <senseApis/senseApiLib.h>
|
|
#include <user/senseDeviceSpec.h>
|
|
|
|
namespace smo {
|
|
namespace sense_api {
|
|
|
|
class SenseApiManager
|
|
{
|
|
public:
|
|
static SenseApiManager& getInstance()
|
|
{
|
|
static SenseApiManager instance;
|
|
return instance;
|
|
}
|
|
|
|
SenseApiLib& loadSenseApiLib(const std::string& libraryPath);
|
|
std::optional<std::reference_wrapper<SenseApiLib>> getSenseApiLib(
|
|
const std::string& libraryPath);
|
|
std::optional<std::reference_wrapper<SenseApiLib>> getSenseApiLibByApiName(
|
|
const std::string& apiName);
|
|
void unloadSenseApiLib(const std::string& libraryPath);
|
|
|
|
void initializeSenseApiLib(SenseApiLib& lib);
|
|
void finalizeSenseApiLib(SenseApiLib& lib);
|
|
|
|
void loadAllSenseApiLibsFromOptions(void);
|
|
void unloadAllSenseApiLibs(void);
|
|
void initializeAllSenseApiLibs(void);
|
|
void finalizeAllSenseApiLibs(void);
|
|
|
|
void attachAllSenseDevicesFromSpecs(void);
|
|
void attachSenseDevice(const device::SenseDeviceSpec& spec);
|
|
void detachSenseDevice(const device::SenseDeviceSpec& spec);
|
|
void detachAllSenseDevices(void);
|
|
|
|
std::string stringifyLibs() const;
|
|
|
|
private:
|
|
SenseApiManager() = default;
|
|
~SenseApiManager() = default;
|
|
|
|
SenseApiManager(const SenseApiManager&) = delete;
|
|
SenseApiManager& operator=(const SenseApiManager&) = delete;
|
|
|
|
std::vector<std::unique_ptr<SenseApiLib>> senseApiLibs;
|
|
};
|
|
|
|
} // namespace sense_api
|
|
} // namespace smo
|
|
|
|
#endif // SENSE_API_MANAGER_H
|