|
libzypp 17.37.9
|
Interface to plugin scripts using a Stomp inspired communication protocol.
More...
#include <zypp/PluginScript.h>
Classes | |
| struct | Impl |
| PluginScript implementation. More... | |
Public Types | |
| using | Arguments = std::vector<std::string> |
| Commandline arguments passed to a script on open. | |
Static Public Attributes | |
| static const pid_t | NotConnected |
pid_t(-1) constant indicating no connection. | |
Friends | |
| std::ostream & | operator<< (std::ostream &str, const PluginScript &obj) |
Related Symbols | |
(Note that these are not member symbols.) | |
| std::ostream & | operator<< (std::ostream &str, const PluginScript &obj) |
| Stream output. | |
Get/set local timeout settings. | |
| RW_pointer< Impl > | _pimpl |
| Pointer to implementation. | |
| long | sendTimeout () const |
| Local default timeout (sec.) when sending data. | |
| long | receiveTimeout () const |
| Local default timeout (sec.) when receiving data. | |
| void | sendTimeout (long newval_r) |
| Set local default timeout (sec.) when sending data. | |
| void | receiveTimeout (long newval_r) |
| Set local default timeout (sec.) when receiving data. | |
| void | timeout (long newval_r) |
| Set local default timeout (sec.) (both: send and receive). | |
| void | open () |
| Setup connection and execute script. | |
| void | open (const Pathname &script_r) |
| void | open (const Pathname &script_r, const Arguments &args_r) |
| int | close () |
| Close any open connection. | |
| void | send (const PluginFrame &frame_r) const |
| Send a PluginFrame. | |
| PluginFrame | receive () const |
| Receive a PluginFrame. | |
Get/set the global timeout settings. | |
Timeout when sending/receiving data to/from a plugin default to 30 sec. The value (in seconds) my be changed via the environment variables | |
| static long | defaultSendTimeout () |
| Global default timeout (sec.) when sending data. | |
| static long | defaultReceiveTimeout () |
| Global default timeout (sec.) when receiving data. | |
| static void | defaultSendTimeout (long newval_r) |
| Set global default timeout (sec.) when sending data. | |
| static void | defaultReceiveTimeout (long newval_r) |
| Set global default timeout (sec.) when receiving data. | |
| static void | defaultTimeout (long newval_r) |
| Set global default timeout (sec.) (both: send and receive). | |
| PluginScript () | |
| Default ctor. | |
| PluginScript (Pathname script_r) | |
| Ctor taking script path and no arguments. | |
| PluginScript (Pathname script_r, Arguments args_r) | |
| Ctor taking script path and script arguments. | |
| const Pathname & | script () const |
| Return the script path if set. | |
| const Arguments & | args () const |
| Return the script arguments if set. | |
| bool | isOpen () const |
| Whether we are connected to a script. | |
| pid_t | getPid () const |
| Return a connected scripts pid or NotConnected. | |
| int | lastReturn () const |
| Remembers a scripts return value after close until next open. | |
| const std::string & | lastExecError () const |
| Remembers a scripts execError string after close until next open. | |
Interface to plugin scripts using a Stomp inspired communication protocol.
Timeout when sending/receiving data to/from a plugin default to 30 sec. The value (in seconds) my be changed via the environment variables ZYPP_PLUGIN_SEND_TIMEOUT, ZYPP_PLUGIN_RECEIVE_TIMEOUT or ZYPP_PLUGIN_TIMEOUT (both: send and receive).
Definition at line 62 of file PluginScript.h.
| using zypp::PluginScript::Arguments = std::vector<std::string> |
Commandline arguments passed to a script on open.
Definition at line 68 of file PluginScript.h.
| zypp::PluginScript::PluginScript | ( | ) |
Default ctor.
Definition at line 477 of file PluginScript.cc.
| zypp::PluginScript::PluginScript | ( | Pathname | script_r | ) |
Ctor taking script path and no arguments.
Definition at line 481 of file PluginScript.cc.
Ctor taking script path and script arguments.
Definition at line 485 of file PluginScript.cc.
|
static |
Global default timeout (sec.) when sending data.
Definition at line 453 of file PluginScript.cc.
|
static |
Global default timeout (sec.) when receiving data.
Definition at line 456 of file PluginScript.cc.
|
static |
Set global default timeout (sec.) when sending data.
Definition at line 459 of file PluginScript.cc.
|
static |
Set global default timeout (sec.) when receiving data.
Definition at line 462 of file PluginScript.cc.
|
inlinestatic |
Set global default timeout (sec.) (both: send and receive).
Definition at line 93 of file PluginScript.h.
| const Pathname & zypp::PluginScript::script | ( | ) | const |
Return the script path if set.
Definition at line 489 of file PluginScript.cc.
| const PluginScript::Arguments & zypp::PluginScript::args | ( | ) | const |
Return the script arguments if set.
Definition at line 492 of file PluginScript.cc.
| bool zypp::PluginScript::isOpen | ( | ) | const |
Whether we are connected to a script.
Definition at line 495 of file PluginScript.cc.
| pid_t zypp::PluginScript::getPid | ( | ) | const |
Return a connected scripts pid or NotConnected.
Definition at line 498 of file PluginScript.cc.
| int zypp::PluginScript::lastReturn | ( | ) | const |
Remembers a scripts return value after close until next open.
Definition at line 501 of file PluginScript.cc.
| const std::string & zypp::PluginScript::lastExecError | ( | ) | const |
Remembers a scripts execError string after close until next open.
Definition at line 504 of file PluginScript.cc.
| long zypp::PluginScript::sendTimeout | ( | ) | const |
Local default timeout (sec.) when sending data.
Definition at line 465 of file PluginScript.cc.
| long zypp::PluginScript::receiveTimeout | ( | ) | const |
Local default timeout (sec.) when receiving data.
Definition at line 468 of file PluginScript.cc.
| void zypp::PluginScript::sendTimeout | ( | long | newval_r | ) |
Set local default timeout (sec.) when sending data.
Definition at line 471 of file PluginScript.cc.
| void zypp::PluginScript::receiveTimeout | ( | long | newval_r | ) |
Set local default timeout (sec.) when receiving data.
Definition at line 474 of file PluginScript.cc.
|
inline |
Set local default timeout (sec.) (both: send and receive).
Definition at line 144 of file PluginScript.h.
| void zypp::PluginScript::open | ( | ) |
Setup connection and execute script.
| PluginScriptException | if already connected to a script |
| PluginScriptException | if script does not exist or is not executable |
| PluginScriptException | on error |
Definition at line 507 of file PluginScript.cc.
| void zypp::PluginScript::open | ( | const Pathname & | script_r | ) |
Definition at line 510 of file PluginScript.cc.
Definition at line 513 of file PluginScript.cc.
| int zypp::PluginScript::close | ( | ) |
Close any open connection.
Definition at line 516 of file PluginScript.cc.
| void zypp::PluginScript::send | ( | const PluginFrame & | frame_r | ) | const |
Send a PluginFrame.
| PluginScriptNotConnected | |
| PluginScriptSendTimeout | |
| PluginScriptDiedUnexpectedly | (does not close) |
| PluginScriptException | on error |
Definition at line 519 of file PluginScript.cc.
| PluginFrame zypp::PluginScript::receive | ( | ) | const |
Receive a PluginFrame.
| PluginScriptNotConnected | |
| PluginScriptReceiveTimeout | |
| PluginScriptDiedUnexpectedly | (does not close) |
| PluginScriptException | on error |
Definition at line 522 of file PluginScript.cc.
|
friend |
Definition at line 527 of file PluginScript.cc.
|
Stream output.
Definition at line 527 of file PluginScript.cc.
|
static |
pid_t(-1) constant indicating no connection.
Definition at line 71 of file PluginScript.h.
|
private |
Pointer to implementation.
Definition at line 188 of file PluginScript.h.