libzypp  15.28.6
zypp::PluginExecutor Class Reference

Parallel execution of stateful PluginScripts. More...

#include <PluginExecutor.h>

Classes

class  Impl
 PluginExecutor implementation. More...
 

Public Member Functions

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

Private Attributes

RW_pointer< Impl_pimpl
 Implementation class. More...
 

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.)

std::ostream & operator<< (std::ostream &str, const PluginExecutor &obj)
 
bool operator== (const PluginExecutor &lhs, const PluginExecutor &rhs)
 
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 41 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

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.

bool zypp::PluginExecutor::empty ( ) const

Whether no plugins are waiting.

Definition at line 164 of file PluginExecutor.cc.

size_t zypp::PluginExecutor::size ( ) const

Number of open plugins.

Definition at line 167 of file PluginExecutor.cc.

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.

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.

Friends And Related Function Documentation

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

Definition at line 176 of file PluginExecutor.cc.

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

Stream output

Definition at line 176 of file PluginExecutor.cc.

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

Comparison based on reference.

Definition at line 88 of file PluginExecutor.h.

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

Comparison based on reference.

Definition at line 92 of file PluginExecutor.h.

Member Data Documentation

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

Implementation class.

Pointer to implementation.

Definition at line 79 of file PluginExecutor.h.


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