libzypp 9.41.1

zypp::PluginExecutor Class Reference

Parallel execution of stateful PluginScripts. More...

#include <PluginExecutor.h>

Inheritance diagram for zypp::PluginExecutor:
zypp::base::SafeBool< PluginExecutor >

List of all members.

Classes

class  Impl
 PluginExecutor implementation. More...

Public Member Functions

 PluginExecutor ()
 Default ctor: Empty plugin list.
 ~PluginExecutor ()
 Dtor: Send PLUGINEND and close all plugins.
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 Member Functions

friend base::SafeBool () const
 Implementation class.
bool boolTest () const

Private Attributes

RW_pointer< Impl_pimpl
 Pointer to implementation.

Friends

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

Related Functions

(Note that these are not member functions.)
bool operator!= (const PluginExecutor &lhs, const PluginExecutor &rhs)

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 42 of file PluginExecutor.h.


Constructor & Destructor Documentation

zypp::PluginExecutor::PluginExecutor ( )

Default ctor: Empty plugin list.

Definition at line 157 of file PluginExecutor.cc.

zypp::PluginExecutor::~PluginExecutor ( )

Dtor: Send PLUGINEND and close all plugins.

Definition at line 161 of file PluginExecutor.cc.


Member Function Documentation

bool zypp::PluginExecutor::empty ( ) const

Whether no plugins are waiting.

Definition at line 164 of file PluginExecutor.cc.

References _pimpl.

Referenced by boolTest().

size_t zypp::PluginExecutor::size ( ) const

Number of open plugins.

Definition at line 167 of file PluginExecutor.cc.

References _pimpl.

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 170 of file PluginExecutor.cc.

References _pimpl.

Referenced by zypp::target::TargetImpl::buildCache(), and zypp::target::TargetImpl::commit().

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 173 of file PluginExecutor.cc.

References _pimpl.

Referenced by zypp::target::TargetImpl::buildCache().

zypp::PluginExecutor::base::SafeBool ( ) const [private]

Implementation class.

bool zypp::PluginExecutor::boolTest ( ) const [inline, private]

Definition at line 85 of file PluginExecutor.h.

References empty().


Friends And Related Function Documentation

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

Stream output

Definition at line 176 of file PluginExecutor.cc.

bool operator== ( const PluginExecutor lhs,
const PluginExecutor rhs 
) [friend]

Comparison based on reference.

Definition at line 96 of file PluginExecutor.h.

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

Comparison based on reference.

Definition at line 100 of file PluginExecutor.h.


Member Data Documentation

Pointer to implementation.

Definition at line 89 of file PluginExecutor.h.

Referenced by empty(), load(), zypp::operator<<(), send(), and size().


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