libzypp 17.31.23
zyppng::ProvideRes Class Reference

A ProvideRes object is a reference counted ownership of a resource in the cache provided by a Provide instance. More...

#include </home/abuild/rpmbuild/BUILD/libzypp-17.31.23/zypp-media/ng/provideres.h>

Public Member Functions

 ProvideRes (std::shared_ptr< ProvideResourceData > dataPtr)
 
virtual ~ProvideRes ()
 
const zypp::Pathname file () const
 
const zypp::ManagedFileasManagedFile () const
 
const ProvideMediaHandlemediaHandle () const
 
const zypp::UrlresourceUrl () const
 
const HeaderValueMapheaders () const
 

Private Attributes

std::shared_ptr< ProvideResourceData_data
 

Detailed Description

A ProvideRes object is a reference counted ownership of a resource in the cache provided by a Provide instance.

It is generally advisable to release a ProvideRes instance asap, to make sure resources can be released and devices are free to be ejected.

Note
all ProvideRes instances will become invalid when the Provide instance is released.

Definition at line 35 of file provideres.h.

Constructor & Destructor Documentation

◆ ProvideRes()

zyppng::ProvideRes::ProvideRes ( std::shared_ptr< ProvideResourceData dataPtr)

Definition at line 17 of file provideres.cc.

◆ ~ProvideRes()

zyppng::ProvideRes::~ProvideRes ( )
virtual

Definition at line 20 of file provideres.cc.

Member Function Documentation

◆ file()

const zypp::filesystem::Pathname zyppng::ProvideRes::file ( ) const

Returns the path to the provided file

Definition at line 23 of file provideres.cc.

◆ asManagedFile()

const zypp::ManagedFile & zyppng::ProvideRes::asManagedFile ( ) const

Returns a reference to the internally used managed file instance.

Note
If you obtain this for a file that is inside the providers working directory ( e.g. a provide result for a download ), the continued use after the Provide instance was relased is undefined behaviour and not supported!

Definition at line 28 of file provideres.cc.

◆ mediaHandle()

const ProvideMediaHandle & zyppng::ProvideRes::mediaHandle ( ) const

Returns a reference to the currently held media handle, this can be a invalid handle

Definition at line 33 of file provideres.cc.

◆ resourceUrl()

const zypp::Url & zyppng::ProvideRes::resourceUrl ( ) const

The URL this ressource was provided from, can be empty

Definition at line 38 of file provideres.cc.

◆ headers()

const HeaderValueMap & zyppng::ProvideRes::headers ( ) const

All headers that were received from the worker when sending the result

Definition at line 43 of file provideres.cc.

Member Data Documentation

◆ _data

std::shared_ptr<ProvideResourceData> zyppng::ProvideRes::_data
private

Definition at line 69 of file provideres.h.


The documentation for this class was generated from the following files: