10#ifndef ZYPP_MEDIA_NG_WORKER_DEVICEDRIVER_H_INCLUDED
11#define ZYPP_MEDIA_NG_WORKER_DEVICEDRIVER_H_INCLUDED
13#include <zypp-media/ng/ProvideFwd>
14#include <zypp-media/ng/worker/ProvideWorker>
15#include <zypp-media/ng/HeaderValueMap>
16#include <zypp-media/Mount>
17#include <zypp-core/zyppng/base/Signals>
18#include <zypp-core/zyppng/base/Base>
19#include <zypp-core/zyppng/base/zyppglobal.h>
20#include <zypp-core/zyppng/pipelines/Expected>
22#include <unordered_map>
41 std::shared_ptr<Device>
_dev;
73 void setProvider ( ProvideWorkerWeakRef workerRef );
117 const std::vector<std::shared_ptr<Device>> &
knownDevices()
const;
122 std::unordered_map<std::string, AttachedMedia> &
attachedMedia();
Base class for Exception.
zypp::Pathname attachRoot() const
zypp::Pathname createAttachPoint(const zypp::Pathname &attach_root) const
virtual zyppng::expected< WorkerCaps > initialize(const zyppng::worker::Configuration &conf)
static const std::function< bool(const zypp::media::MountEntry &)> fstypePredicate(const std::string &src, const std::vector< std::string > &fstypes)
bool checkAttached(const zypp::Pathname &mountPoint, const std::function< bool(const zypp::media::MountEntry &)> predicate)
zyppng::worker::Configuration _config
ProvideWorkerWeakRef _parentWorker
bool detachMedia(const std::string &attachId)
zypp::Pathname _attachRoot
virtual bool isVolatile() const
void setProvider(ProvideWorkerWeakRef workerRef)
zyppng::expected< void > isDesiredMedium(const zypp::Url &deviceUrl, const zypp::Pathname &mountPoint, const zyppng::MediaDataVerifierRef &verifier, uint mediaNr=1)
WorkerCaps::WorkerType _wType
static const std::function< bool(const zypp::media::MountEntry &)> bindMountPredicate(const std::string &src)
virtual void detectDevices()
std::unordered_map< std::string, AttachedMedia > & attachedMedia()
std::vector< std::shared_ptr< Device > > & knownDevices()
virtual AttachResult mountDevice(const uint32_t id, const zypp::Url &mediaUrl, const std::string &attachId, const std::string &label, const HeaderValueMap &extras)=0
const zyppng::worker::Configuration & config() const
virtual void immediateShutdown()
void removeAttachPoint(const zypp::Pathname &attach_pt) const
std::vector< std::shared_ptr< Device > > _sysDevs
std::unordered_map< std::string, AttachedMedia > _attachedMedia
ProvideWorkerRef parentWorker() const
void releaseIdleDevices()
static const std::function< bool(const zypp::media::MountEntry &)> devicePredicate(unsigned int majNr, unsigned int minNr)
void setAttachRoot(const zypp::Pathname &root)
virtual void unmountDevice(Device &dev)
ZYPP_FWD_DECL_TYPE_WITH_REFS(DeviceDriver)
zypp::proto::Configuration Configuration
expected< void, AttachError > AttachResult
A "struct mntent" like mount entry structure, but using std::strings.
std::unordered_map< std::string, std::any > _properties
std::string _name
Path of the device node or URL for e.g. nfs devices.
unsigned int _min_nr
Minor number of the device.
unsigned int _maj_nr
Major number of the device.
bool _ephemeral
If set to true the device is removed from the internal list after the last attachpoint was released.
zypp::Pathname _mountPoint
Mountpoint of the device, if empty dev is not mounted.