libzypp 17.37.10

zypp::NullDeleter Struct Reference

shared_ptr custom deleter doing nothing. More...

`#include <zypp-core/base/PtrTypes.h>`

## Public Member Functions
void | operator() (const void *const) const

## Detailed Description

shared_ptr custom deleter doing nothing.

A custom deleter is a function being called when the last shared_ptr goes out of score. Per default the object gets deleted, but you can insall custom deleters as well. This one does nothing.

// Some class providing a std::istream
struct InpuStream
{
// Per deafult use std::cin.
InputStream()
: _stream( &std::cin, NullDeleter() )
{}
// Or read from a file.
InputStream( const Pathname & file_r )
: _stream( new ifgzstream( _path.asString().c_str() ) )
{}
// Or use a stream priovided by the application.
InputStream( std::istream & stream_r )
: _stream( &stream_r, NullDeleter() )
{}
std::istream & stream()
{ return *_stream; }
private:
shared_ptr<std::istream> _stream;
};
zypp::InputStream
Helper to create and pass std::istream.
Definition inputstream.h:57
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:47
std
Definition Arch.h:364
zypp::ifgzstream
detail::fXstream< std::istream, gzstream_detail::fgzstreambuf > ifgzstream
istream reading gzip files as well as plain files.
Definition gzstream.h:157
zypp::asString
std::string asString(const Patch::Category &obj)
Definition Patch.cc:122
zypp::NullDeleter
shared_ptr custom deleter doing nothing.
Definition PtrTypes.h:84

Definition at line 83 of file PtrTypes.h.

## Member Function Documentation

## ◆ operator()()

void zypp::NullDeleter::operator() | ( | const void * const |  | ) | const
| inline

Definition at line 85 of file PtrTypes.h.

The documentation for this struct was generated from the following file:

- zypp-core/base/PtrTypes.h