libzypp 17.37.17
zypp::PluginExecutor Class Reference

Parallel execution of stateful PluginScripts. More...

#include <zypp/PluginExecutor.h>

Classes

class  Impl
 PluginExecutor implementation. More...

Public Member Functions

 PluginExecutor ()
 Default ctor: Empty plugin list.
 ~PluginExecutor ()
 Dtor: Send PLUGINEND and close all plugins.
 operator bool () const
 Validate object in a boolean context: There are plugins waiting for input.
bool empty () const
 Whether no plugins are waiting.
size_t size () const
 Number of open plugins.
void load (const Pathname &path_r)
 Find and launch plugins sending PLUGINBEGIN.
void send (const PluginFrame &frame_r)
 Send PluginFrame to all open plugins.

Private Attributes

RW_pointer< Impl_pimpl
 Implementation class.

Friends

std::ostream & operator<< (std::ostream &str, const PluginExecutor &obj)
bool operator== (const PluginExecutor &lhs, const PluginExecutor &rhs)

(Note that these are not member symbols.)

std::ostream & operator<< (std::ostream &str, const PluginExecutor &obj)
 Stream output.
bool operator== (const PluginExecutor &lhs, const PluginExecutor &rhs)
 Comparison based on reference.
bool operator!= (const PluginExecutor &lhs, const PluginExecutor &rhs)
 Comparison based on reference.

Detailed Description

Parallel execution of stateful PluginScripts.

Sent PluginFrames are distributed to all open PluginScripts and need to be receipted by sending back either ACK or _ENOMETHOD command.

All PluginScripts receive an initial PLUGINBEGIN frame, containing a userdata header if ZConfig::userData are defined.

See also
also zypper '–userdata' option

A final PLUGINEND frame is sent and open scripts are closed, when the executors last reference goes out of scope. Failing PluginScripts are closed immediately.

See also
PluginScript

Definition at line 41 of file PluginExecutor.h.

Constructor & Destructor Documentation

◆ PluginExecutor()

zypp::PluginExecutor::PluginExecutor ( )

Default ctor: Empty plugin list.

Definition at line 161 of file PluginExecutor.cc.

◆ ~PluginExecutor()

zypp::PluginExecutor::~PluginExecutor ( )

Dtor: Send PLUGINEND and close all plugins.

Definition at line 165 of file PluginExecutor.cc.

Member Function Documentation

◆ operator bool()

zypp::PluginExecutor::operator bool ( ) const
inlineexplicit

Validate object in a boolean context: There are plugins waiting for input.

Definition at line 55 of file PluginExecutor.h.

◆ empty()

bool zypp::PluginExecutor::empty ( ) const

Whether no plugins are waiting.

Definition at line 168 of file PluginExecutor.cc.

◆ size()

size_t zypp::PluginExecutor::size ( ) const

Number of open plugins.

Definition at line 171 of file PluginExecutor.cc.

◆ load()

void zypp::PluginExecutor::load ( const Pathname & path_r)

Find and launch plugins sending PLUGINBEGIN.

If path_r is a directory all executable files within are expected to be plugins. Otherwise path_r must point to an executable plugin.

Definition at line 174 of file PluginExecutor.cc.

◆ send()

void zypp::PluginExecutor::send ( const PluginFrame & frame_r)

Send PluginFrame to all open plugins.

Failed plugins are removed from the execution list.

Definition at line 177 of file PluginExecutor.cc.

◆ operator<< [1/2]

std::ostream & operator<< ( std::ostream & str,
const PluginExecutor & obj )
friend

Definition at line 180 of file PluginExecutor.cc.

◆ operator== [1/2]

bool operator== ( const PluginExecutor & lhs,
const PluginExecutor & rhs )
friend

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream & str,
const PluginExecutor & obj )
related

Stream output.

Definition at line 180 of file PluginExecutor.cc.

◆ operator==() [2/2]

bool operator== ( const PluginExecutor & lhs,
const PluginExecutor & rhs )
related

Comparison based on reference.

Definition at line 88 of file PluginExecutor.h.

◆ operator!=()

bool operator!= ( const PluginExecutor & lhs,
const PluginExecutor & rhs )
related

Comparison based on reference.

Definition at line 92 of file PluginExecutor.h.

Member Data Documentation

◆ _pimpl

RW_pointer<Impl> zypp::PluginExecutor::_pimpl
private

Implementation class.

Pointer to implementation.

Definition at line 81 of file PluginExecutor.h.


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