|
libzypp 17.37.5
|
#include <zypp-media/ng/worker/devicedriver.h>
Public Member Functions | |
| DeviceDriver (WorkerCaps::WorkerType wType) | |
| void | setProvider (ProvideWorkerWeakRef workerRef) |
| virtual AttachResult | mountDevice (const uint32_t id, const zypp::Url &mediaUrl, const std::string &attachId, const std::string &label, const HeaderValueMap &extras)=0 |
| virtual zyppng::expected< WorkerCaps > | initialize (const zyppng::worker::Configuration &conf) |
| bool | detachMedia (const std::string &attachId) |
| void | releaseIdleDevices () |
| virtual void | detectDevices () |
| std::vector< std::shared_ptr< Device > > & | knownDevices () |
| const std::vector< std::shared_ptr< Device > > & | knownDevices () const |
| std::unordered_map< std::string, AttachedMedia > & | attachedMedia () |
| virtual bool | isVolatile () const |
| void | setAttachRoot (const zypp::Pathname &root) |
| zypp::Pathname | attachRoot () const |
| virtual void | immediateShutdown () |
| ProvideWorkerRef | parentWorker () const |
| const zyppng::worker::Configuration & | config () const |
Public Member Functions inherited from zyppng::Base | |
| Base () | |
| virtual | ~Base () |
| WeakPtr | parent () const |
| void | addChild (const Base::Ptr &child) |
| void | removeChild (const Ptr &child) |
| const std::unordered_set< Ptr > & | children () const |
| std::thread::id | threadId () const |
| template<typename T> | |
| std::vector< std::weak_ptr< T > > | findChildren () const |
| template<typename T> | |
| std::shared_ptr< T > | shared_this () const |
| template<typename T> | |
| std::shared_ptr< T > | shared_this () |
| template<typename T> | |
| std::weak_ptr< T > | weak_this () const |
| template<typename T> | |
| std::weak_ptr< T > | weak_this () |
| template<typename SenderFunc, typename ReceiverFunc> | |
| auto | connect (SenderFunc &&sFun, typename internal::MemberFunction< ReceiverFunc >::ClassType &recv, ReceiverFunc &&rFunc) |
| template<typename SenderFunc, typename ReceiverFunc, typename ... Tracker> | |
| std::enable_if_t< std::is_member_function_pointer_v< SenderFunc >, connection > | connectFunc (SenderFunc &&sFun, ReceiverFunc &&rFunc, const Tracker &...trackers) |
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) |
Protected Member Functions inherited from zyppng::Base | |
| Base (BasePrivate &dd) | |
Static Protected Member Functions | |
| 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 | |
Public Types inherited from zyppng::Base | |
| using | Ptr = std::shared_ptr<Base> |
| using | WeakPtr = std::weak_ptr<Base> |
Static Public Member Functions inherited from zyppng::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) |
Protected Attributes inherited from zyppng::Base | |
| 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.
|
protectedvirtual |
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
Definition at line 315 of file devicedriver.cc.
|
staticprotected |
Returns a predicate for the checkAttached function that looks for a virtual mount ( like smb or nfs ) in the mount table
Definition at line 331 of file devicedriver.cc.
|
staticprotected |
Returns a predicate for the checkAttached function that looks for a bind mount in the mount table
Definition at line 347 of file devicedriver.cc.
|
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.