libzypp  12.16.5
zypp::callback::TempConnect< _Report > Struct Template Reference

Temporarily connect a ReceiveReport then restore the previous one. More...

#include <Callback.h>

Public Types

typedef _Report ReportType
 
typedef ReceiveReport< _ReportReceiver
 
typedef DistributeReport< _ReportDistributor
 

Public Member Functions

 TempConnect ()
 
 TempConnect (Receiver &rec_r)
 
 ~TempConnect ()
 

Private Attributes

Receiver_oldRec
 

Detailed Description

template<class _Report>
struct zypp::callback::TempConnect< _Report >

Temporarily connect a ReceiveReport then restore the previous one.

Pass the ReceiveReport you want to connect temporarily to the ctor. The ReceiveReport is connected, a previously connected ReceiveReport is remembered and re-connected in the dtor. Use the default ctpr to temporarily disconnect any connected report.

struct FooReceive : public callback::ReceiveReport<Foo>
{..};
struct FooReceive2 : public callback::ReceiveReport<Foo>
{..};
FooReceive r;
FooReceive2 r2;
r.connect();
... // r receiving the report
{
callback::TempConnect<Foo> temp( r2 );
...// r2 receiving the report
}
...// r receiving the report

Definition at line 255 of file Callback.h.

Member Typedef Documentation

template<class _Report>
typedef _Report zypp::callback::TempConnect< _Report >::ReportType

Definition at line 257 of file Callback.h.

template<class _Report>
typedef ReceiveReport<_Report> zypp::callback::TempConnect< _Report >::Receiver

Definition at line 258 of file Callback.h.

Definition at line 259 of file Callback.h.

Constructor & Destructor Documentation

template<class _Report>
zypp::callback::TempConnect< _Report >::TempConnect ( )
inline

Definition at line 261 of file Callback.h.

template<class _Report>
zypp::callback::TempConnect< _Report >::TempConnect ( Receiver rec_r)
inline

Definition at line 267 of file Callback.h.

template<class _Report>
zypp::callback::TempConnect< _Report >::~TempConnect ( )
inline

Definition at line 273 of file Callback.h.

Member Data Documentation

template<class _Report>
Receiver* zypp::callback::TempConnect< _Report >::_oldRec
private

Definition at line 281 of file Callback.h.


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