libzypp 17.37.17
|
Manages a data source characterized by an authoritative URL and a list of mirror URLs. More...
#include <zypp-core/MirroredOrigin.h>
Classes | |
class | iter |
struct | Private |
Public Types | |
using | endpoint_iterator = iter<MirroredOrigin, OriginEndpoint> |
using | endpoint_const_iterator = iter<MirroredOrigin const, OriginEndpoint const> |
Public Member Functions | |
MirroredOrigin () | |
MirroredOrigin (OriginEndpoint authority, std::vector< OriginEndpoint > mirrors={}) | |
void | setAuthority (OriginEndpoint newAuthority) |
const OriginEndpoint & | authority () const |
const std::vector< OriginEndpoint > & | mirrors () const |
bool | isValid () const |
bool | addMirror (OriginEndpoint newMirror) |
void | setMirrors (std::vector< OriginEndpoint > mirrors) |
void | clearMirrors () |
std::string | scheme () const |
bool | schemeIsDownloading () const |
endpoint_iterator | begin () |
endpoint_iterator | end () |
endpoint_const_iterator | begin () const |
endpoint_const_iterator | end () const |
uint | endpointCount () const |
const OriginEndpoint & | operator[] (uint index) const |
OriginEndpoint & | operator[] (uint index) |
const OriginEndpoint & | at (uint index) const |
OriginEndpoint & | at (uint index) |
Private Attributes | |
RWCOW_pointer< Private > | _pimpl |
Manages a data source characterized by an authoritative URL and a list of mirror URLs.
A MirroredOrigin object encapsulates the access information for a data source that has a primary (authoritative) access point and potentially multiple alternative (mirror) access points. This class is designed to be generic and can be used for various types of data sources where redundancy or alternative access points are needed.
The core components managed by MirroredOrigin are:
Beyond just the URLs, this class can be extended or used in conjunction with mechanisms to store configuration settings pertinent to accessing these URLs (e.g., priorities, credentials, retry strategies). This makes it a more comprehensive definition for a data endpoint than a simple URL string.
This class provides a structured way to handle primary and alternative locations for any resource that might be replicated.
Definition at line 170 of file MirroredOrigin.h.
Definition at line 216 of file MirroredOrigin.h.
using zypp::MirroredOrigin::endpoint_const_iterator = iter<MirroredOrigin const, OriginEndpoint const> |
Definition at line 217 of file MirroredOrigin.h.
zypp::MirroredOrigin::MirroredOrigin | ( | ) |
Definition at line 151 of file MirroredOrigin.cc.
zypp::MirroredOrigin::MirroredOrigin | ( | OriginEndpoint | authority, |
std::vector< OriginEndpoint > | mirrors = {} ) |
Definition at line 155 of file MirroredOrigin.cc.
void zypp::MirroredOrigin::setAuthority | ( | OriginEndpoint | newAuthority | ) |
Changes the authority to newAuthority
Definition at line 161 of file MirroredOrigin.cc.
const OriginEndpoint & zypp::MirroredOrigin::authority | ( | ) | const |
Definition at line 184 of file MirroredOrigin.cc.
const std::vector< OriginEndpoint > & zypp::MirroredOrigin::mirrors | ( | ) | const |
Definition at line 189 of file MirroredOrigin.cc.
bool zypp::MirroredOrigin::isValid | ( | ) | const |
Definition at line 194 of file MirroredOrigin.cc.
bool zypp::MirroredOrigin::addMirror | ( | OriginEndpoint | newMirror | ) |
Definition at line 199 of file MirroredOrigin.cc.
void zypp::MirroredOrigin::setMirrors | ( | std::vector< OriginEndpoint > | mirrors | ) |
Definition at line 213 of file MirroredOrigin.cc.
void zypp::MirroredOrigin::clearMirrors | ( | ) |
Definition at line 220 of file MirroredOrigin.cc.
std::string zypp::MirroredOrigin::scheme | ( | ) | const |
Definition at line 225 of file MirroredOrigin.cc.
bool zypp::MirroredOrigin::schemeIsDownloading | ( | ) | const |
Definition at line 230 of file MirroredOrigin.cc.
|
inline |
A iterator over all endpoints, including authority at index 0
Definition at line 259 of file MirroredOrigin.h.
|
inline |
End iterator over all endpoints, including authority at index 0
Definition at line 266 of file MirroredOrigin.h.
|
inline |
Definition at line 270 of file MirroredOrigin.h.
|
inline |
Definition at line 274 of file MirroredOrigin.h.
uint zypp::MirroredOrigin::endpointCount | ( | ) | const |
Definition at line 235 of file MirroredOrigin.cc.
|
inline |
Index based access to endpoints, index 0 is always the authority
std::out_of_range | on a out of range index param |
Definition at line 287 of file MirroredOrigin.h.
|
inline |
Definition at line 288 of file MirroredOrigin.h.
const OriginEndpoint & zypp::MirroredOrigin::at | ( | uint | index | ) | const |
Index based access to endpoints, index 0 is always the authority
Definition at line 241 of file MirroredOrigin.cc.
OriginEndpoint & zypp::MirroredOrigin::at | ( | uint | index | ) |
Definition at line 253 of file MirroredOrigin.cc.
|
private |
Definition at line 298 of file MirroredOrigin.h.