libzypp 17.34.0
|
#include <zypp-media/ng/worker/devicedriver.h>
Protected Member Functions | |
virtual void | unmountDevice (Device &dev) |
zyppng::expected< void > | isDesiredMedium (const zypp::Url &deviceUrl, const zypp::Pathname &mountPoint, const zyppng::MediaDataVerifierRef &verifier, uint mediaNr=1) |
zypp::Pathname | createAttachPoint (const zypp::Pathname &attach_root) const |
void | removeAttachPoint (const zypp::Pathname &attach_pt) const |
bool | checkAttached (const zypp::Pathname &mountPoint, const std::function< bool(const zypp::media::MountEntry &)> predicate) |
![]() | |
Base (BasePrivate &dd) | |
Static Protected Attributes | |
static const std::function< bool(const zypp::media::MountEntry &) | devicePredicate )(unsigned int majNr, unsigned int minNr) |
static const std::function< bool(const zypp::media::MountEntry &) | fstypePredicate )(const std::string &src, const std::vector< std::string > &fstypes) |
static const std::function< bool(const zypp::media::MountEntry &) | bindMountPredicate )(const std::string &src) |
Private Attributes | |
WorkerCaps::WorkerType | _wType |
ProviderConfiguration | _config |
time_t | _attach_mtime = 0 |
zypp::Pathname | _attachRoot |
std::vector< std::shared_ptr< Device > > | _sysDevs |
std::unordered_map< std::string, AttachedMedia > | _attachedMedia |
ProvideWorkerWeakRef | _parentWorker |
Additional Inherited Members | |
![]() | |
using | Ptr = std::shared_ptr<Base> |
using | WeakPtr = std::weak_ptr<Base> |
![]() | |
template<typename Obj , typename Functor > | |
static decltype(auto) | make_base_slot (Obj *o, Functor &&f) |
template<typename SenderFunc , typename ReceiverFunc > | |
static auto | connect (typename internal::MemberFunction< SenderFunc >::ClassType &s, SenderFunc &&sFun, typename internal::MemberFunction< ReceiverFunc >::ClassType &recv, ReceiverFunc &&rFunc) |
template<typename SenderFunc , typename ReceiverFunc , typename ... Tracker> | |
static auto | connectFunc (typename internal::MemberFunction< SenderFunc >::ClassType &s, SenderFunc &&sFun, ReceiverFunc &&rFunc, const Tracker &...trackers) |
![]() | |
std::unique_ptr< BasePrivate > | d_ptr |
Abstract base class to be used together with the
Definition at line 65 of file devicedriver.h.
zyppng::worker::DeviceDriver::DeviceDriver | ( | WorkerCaps::WorkerType | wType | ) |
Definition at line 25 of file devicedriver.cc.
void zyppng::worker::DeviceDriver::setProvider | ( | ProvideWorkerWeakRef | workerRef | ) |
Tells the driver which provide worker to use when requiring auth data or media changes
Definition at line 29 of file devicedriver.cc.
|
pure virtual |
Called by the provide loop whenever a attach request is received.
|
virtual |
Definition at line 34 of file devicedriver.cc.
bool zyppng::worker::DeviceDriver::detachMedia | ( | const std::string & | attachId | ) |
Detaches the medium referenced by attachId. Returns false if the medium could not be found
Definition at line 59 of file devicedriver.cc.
void zyppng::worker::DeviceDriver::releaseIdleDevices | ( | ) |
Physically detaches all devices that are not referenced by a attachment anymore
Definition at line 69 of file devicedriver.cc.
|
virtual |
Called by the parent to populate the device array every time a provide request arrives, only relevant for workers that operate on detectable devices. The base implementation does nothing
Definition at line 84 of file devicedriver.cc.
std::vector< std::shared_ptr< Device > > & zyppng::worker::DeviceDriver::knownDevices | ( | ) |
Returns a list of all currently known devices, a subclass should always make sure that all currently mounted devices are present in that list.
Definition at line 89 of file devicedriver.cc.
const std::vector< std::shared_ptr< Device > > & zyppng::worker::DeviceDriver::knownDevices | ( | ) | const |
Returns a list of all currently known devices, a subclass should always make sure that all currently mounted devices are present in that list.
Definition at line 94 of file devicedriver.cc.
std::unordered_map< std::string, AttachedMedia > & zyppng::worker::DeviceDriver::attachedMedia | ( | ) |
Returns the list of currently attached medias
Definition at line 99 of file devicedriver.cc.
|
virtual |
Returns true if the worker handles volatile devices ( e.g. DVDs ). The default impl returns false.
Definition at line 138 of file devicedriver.cc.
void zyppng::worker::DeviceDriver::setAttachRoot | ( | const zypp::Pathname & | root | ) |
Changes the attach root to a specific path, otherwise realpath(".") is used.
Definition at line 143 of file devicedriver.cc.
zypp::Pathname zyppng::worker::DeviceDriver::attachRoot | ( | ) | const |
Returns the attachRoot as dictated by the controller
Definition at line 148 of file devicedriver.cc.
|
virtual |
The system is shutting down, release all ressources
Definition at line 104 of file devicedriver.cc.
ProvideWorkerRef zyppng::worker::DeviceDriver::parentWorker | ( | ) | const |
Returns the parent worker if set
Definition at line 118 of file devicedriver.cc.
const zyppng::worker::Configuration & zyppng::worker::DeviceDriver::config | ( | ) | const |
Returns the configuration that was sent by the controller
Definition at line 157 of file devicedriver.cc.
Forcefully unmounts the device, this does not check if there any attached medias still relying on it
Definition at line 123 of file devicedriver.cc.
|
protected |
Checks if the medium deviceUrl mounted on path matches the verifier and mediaNr
Definition at line 162 of file devicedriver.cc.
|
protected |
Definition at line 209 of file devicedriver.cc.
|
protected |
Definition at line 268 of file devicedriver.cc.
|
protected |
Definition at line 283 of file devicedriver.cc.
|
staticprotected |
Returns a predicate for the checkAttached function that looks for a real device in the mount table
|
staticprotected |
Returns a predicate for the checkAttached function that looks for a virtual mount ( like smb or nfs ) in the mount table
|
staticprotected |
Returns a predicate for the checkAttached function that looks for a bind mount in the mount table
|
private |
Definition at line 188 of file devicedriver.h.
|
private |
Definition at line 189 of file devicedriver.h.
|
private |
Definition at line 190 of file devicedriver.h.
|
private |
Definition at line 191 of file devicedriver.h.
|
private |
Definition at line 192 of file devicedriver.h.
|
private |
Definition at line 193 of file devicedriver.h.
|
private |
Definition at line 194 of file devicedriver.h.