libzypp 17.37.1
attachedmediainfo_p.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\----------------------------------------------------------------------/
9*
10* This file contains private API, this might break at any time between releases.
11* You have been warned!
12*
13*/
14#ifndef ZYPP_MEDIA_PRIVATE_ATTACHEDMEDIAINFO_P_H_INCLUDED
15#define ZYPP_MEDIA_PRIVATE_ATTACHEDMEDIAINFO_P_H_INCLUDED
16
17#include "providefwd_p.h"
18#include "providequeue_p.h"
20#include <zypp-media/ng/ProvideSpec>
21#include <string>
22#include <chrono>
23#include <optional>
24
25namespace zyppng {
26
27 class ProvidePrivate;
28
30
32
33 protected:
34 void unref_to( unsigned int refCnt ) const override;
35 void ref_to( unsigned refCnt ) const override;
36
37 public:
38 AttachedMediaInfo( const std::string &id, ProvideQueue::Config::WorkerType workerType, const zypp::Url &baseUrl, const std::vector<zypp::Url> &mirrors, ProvideMediaSpec &spec );
39 AttachedMediaInfo( const std::string &id, ProvideQueueWeakRef backingQueue, ProvideQueue::Config::WorkerType workerType, const zypp::Url &baseUrl, const std::vector<zypp::Url> &mirrors, const ProvideMediaSpec &mediaSpec, const std::optional<zypp::Pathname> &mnt = {} );
40
41 void setName( std::string &&name );
42 const std::string &name() const;
43
44 zypp::Url attachedUrl() const;
45
49 bool isSameMedium ( const std::vector<zypp::Url> &urls, const ProvideMediaSpec &spec );
50
51 static bool isSameMedium ( const std::vector<zypp::Url> &mirrorsA, const ProvideMediaSpec &specA, const std::vector<zypp::Url> &mirrorsB, const ProvideMediaSpec &specB );
52
53 std::string _name;
54 ProvideQueueWeakRef _backingQueue; //< if initialized contains a weak reference to the queue that owns this medium
56 std::vector<zypp::Url> _mirrors; // if the worker supports mirrors ( downloading ) they will be here
58 std::optional<zypp::Pathname> _localMountPoint; // if initialized tells where the workers mounted to medium
59 mutable std::optional<std::chrono::steady_clock::time_point> _idleSince;
60 };
61
62}
63
64#endif
Url manipulation class.
Definition Url.h:93
Base class for reference counted objects.
void unref_to(unsigned int refCnt) const override
bool isSameMedium(const std::vector< zypp::Url > &urls, const ProvideMediaSpec &spec)
const std::string & name() const
std::optional< zypp::Pathname > _localMountPoint
AttachedMediaInfo(const std::string &id, ProvideQueue::Config::WorkerType workerType, const zypp::Url &baseUrl, const std::vector< zypp::Url > &mirrors, ProvideMediaSpec &spec)
std::optional< std::chrono::steady_clock::time_point > _idleSince
Set if the medium is idle.
void ref_to(unsigned refCnt) const override
Trigger derived classes after refCount was increased.
ProvideQueueWeakRef _backingQueue
void setName(std::string &&name)
std::vector< zypp::Url > _mirrors
ProvideQueue::Config::WorkerType _workerType
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition NonCopyable.h:26
#define DEFINE_PTR_TYPE(NAME)
Forward declaration of Ptr types.
Definition PtrTypes.h:639