#ifndef DEVICEMANAGER_H #define DEVICEMANAGER_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace smo { namespace device { class DeviceReattacher; class DeviceManager { public: struct DeviceAttachmentIndResult { bool success = false; std::shared_ptr deviceRole; std::shared_ptr deviceSpec; }; 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); mrntt::MrnttViralPostingInvoker newDeviceAttachmentSpecIndCReq(const DeviceAttachmentSpec &spec); mrntt::MrnttViralPostingInvoker removeDeviceAttachmentSpecCReq(const DeviceAttachmentSpec &spec); mrntt::MrnttViralPostingInvoker attachStimBuffDeviceCReq( const std::shared_ptr& spec); mrntt::MrnttViralPostingInvoker detachStimBuffDeviceCReq( const std::shared_ptr& spec); mrntt::MrnttViralPostingInvoker attachAllUnattachedDevicesFromCReq( const std::shared_ptr> &specs); mrntt::MrnttViralPostingInvoker attachAllUnattachedDevicesFromKnownListCReq(); mrntt::MrnttViralPostingInvoker attachAllUnattachedDevicesFromCmdlineCReq(); mrntt::MrnttViralPostingInvoker detachAllAttachedDeviceRolesCReq(); private: DeviceManager() : s("DeviceManager") {} ~DeviceManager(); DeviceManager(const DeviceManager&) = delete; DeviceManager& operator=(const DeviceManager&) = delete; public: struct Resources { std::vector> deviceAttachmentSpecs; std::vector> devices; std::vector> attachedDeviceRoles; std::vector commandLineDASpecs; std::string allDapSpecs; }; sscl::SharedResourceGroup s; private: std::unique_ptr deviceReattacher; }; } // namespace device } // namespace smo #endif // DEVICEMANAGER_H