#ifndef DEVICEMANAGER_H #define DEVICEMANAGER_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace smo { namespace device { class DeviceReattacher; class DeviceManager { public: static DeviceManager& getInstance() { static DeviceManager instance; return instance; } void initialize(void) {}; void finalize(void) {}; void initializeDeviceReattacher(); void finalizeDeviceReattacher(); 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, sscl::Callback callback); void removeDeviceAttachmentSpecReq( const DeviceAttachmentSpec &spec, sscl::Callback callback); // Device attachment/detachment methods moved from SenseApiManager typedef stim_buff::sal_mlo_attachDeviceReqCbFn attachStimBuffDeviceReqCbFn; typedef stim_buff::sal_mlo_detachDeviceReqCbFn detachStimBuffDeviceReqCbFn; void attachStimBuffDeviceReq( const std::shared_ptr& spec, sscl::Callback cb); void detachStimBuffDeviceReq( const std::shared_ptr& spec, sscl::Callback cb); typedef std::function attachAllUnattachedDevicesFromReqCbFn; typedef std::function detachAllAttachedDeviceRolesCbFn; void attachAllUnattachedDevicesFromReq( const std::shared_ptr> &specs, sscl::Callback cb); void attachAllUnattachedDevicesFromKnownListReq( sscl::Callback cb); void attachAllUnattachedDevicesFromCmdlineReq( sscl::Callback cb); void detachAllAttachedDeviceRoles( sscl::Callback cb); private: DeviceManager() : qutex("DeviceManager"), deviceReattacher(nullptr) {} ~DeviceManager(); DeviceManager(const DeviceManager&) = delete; DeviceManager& operator=(const DeviceManager&) = delete; public: sscl::Qutex qutex; std::string allDapSpecs; static std::vector> deviceAttachmentSpecs; static std::vector> devices; static std::vector> attachedDeviceRoles; static std::vector commandLineDASpecs; private: std::unique_ptr deviceReattacher; class NewDeviceAttachmentSpecInd; class RemoveDeviceAttachmentSpecReq; class AttachStimBuffDeviceReq; typedef AttachStimBuffDeviceReq DetachStimBuffDeviceReq; class AttachAllUnattachedDevicesFromReq; class AttachAllUnattachedDevicesFromKnownListReq; class DetachAllAttachedDeviceRoles; }; } // namespace device } // namespace smo #endif // DEVICEMANAGER_H