libzypp 9.41.1
|
Parallel execution of stateful PluginScripts. More...
#include <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. | |
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) |
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.
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.
Definition at line 42 of file PluginExecutor.h.
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.
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 |
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().
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.
RW_pointer<Impl> zypp::PluginExecutor::_pimpl [private] |
Pointer to implementation.
Definition at line 89 of file PluginExecutor.h.
Referenced by empty(), load(), zypp::operator<<(), send(), and size().