#ifndef DEVICEMANAGER_H #define DEVICEMANAGER_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace smo { namespace device { class DeviceManager { public: static DeviceManager& getInstance() { static DeviceManager instance; return instance; } void initialize(void) {}; void finalize(void) {}; std::string readDapSpecFile(const std::string& filename); void collateAllDapSpecs(void); void parseAllDapSpecs(void); static const std::string stringifyDeviceSpecs(void); typedef std::function deviceRole, std::shared_ptr deviceSpec)> newDeviceAttachmentSpecIndCbFn; typedef std::function deviceSpec)> removeDeviceAttachmentSpecReqCbFn; void newDeviceAttachmentSpecInd( const DeviceAttachmentSpec &spec, Callback callback); void removeDeviceAttachmentSpecReq( const DeviceAttachmentSpec &spec, Callback callback); // Device attachment/detachment methods moved from SenseApiManager typedef sense_api::sal_mlo_attachDeviceReqCbFn attachSenseDeviceReqCbFn; typedef sense_api::sal_mlo_detachDeviceReqCbFn detachSenseDeviceReqCbFn; void attachSenseDeviceReq( const std::shared_ptr& spec, Callback cb); void detachSenseDeviceReq( const std::shared_ptr& spec, Callback cb); typedef std::function attachAllSenseDevicesFromSpecsReqCbFn; typedef std::function detachAllSenseDevicesReqCbFn; void attachAllSenseDevicesFromSpecsReq( Callback cb); void detachAllSenseDevicesReq( Callback cb); private: DeviceManager() : qutex("DeviceManager") {} ~DeviceManager() = default; DeviceManager(const DeviceManager&) = delete; DeviceManager& operator=(const DeviceManager&) = delete; public: Qutex qutex; std::string allDapSpecs; static std::vector> deviceAttachmentSpecs; static std::vector> devices; static std::vector> attachedDeviceRoles; private: class NewDeviceAttachmentSpecInd; class RemoveDeviceAttachmentSpecReq; class AttachSenseDeviceReq; typedef AttachSenseDeviceReq DetachSenseDeviceReq; class AttachAllSenseDevicesFromSpecsReq; class DetachAllSenseDevicesReq; }; } // namespace device } // namespace smo #endif // DEVICEMANAGER_H