libzypp 9.41.1
|
00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00011 #ifndef ZYPP_PLUGINEXECUTOR_H 00012 #define ZYPP_PLUGINEXECUTOR_H 00013 00014 #include <iosfwd> 00015 00016 #include "zypp/base/PtrTypes.h" 00017 #include "zypp/base/SafeBool.h" 00018 #include "zypp/PluginScript.h" 00019 00021 namespace zypp 00022 { 00042 class PluginExecutor : private base::SafeBool<PluginExecutor> 00043 { 00044 friend std::ostream & operator<<( std::ostream & str, const PluginExecutor & obj ); 00045 friend bool operator==( const PluginExecutor & lhs, const PluginExecutor & rhs ); 00046 00047 public: 00049 PluginExecutor(); 00050 00052 ~PluginExecutor(); 00053 00054 public: 00055 #ifndef SWIG // Swig treats it as syntax error 00056 00057 using base::SafeBool<PluginExecutor>::operator bool_type; 00058 #endif 00059 00060 bool empty() const; 00061 00063 size_t size() const; 00064 00065 public: 00072 void load( const Pathname & path_r ); 00073 00077 void send( const PluginFrame & frame_r ); 00078 00079 public: 00080 class Impl; 00081 private: 00082 #ifndef SWIG // Swig treats it as syntax error 00083 friend base::SafeBool<PluginExecutor>::operator bool_type() const; 00084 #endif 00085 bool boolTest() const 00086 { return !empty(); } 00087 00088 private: 00089 RW_pointer<Impl> _pimpl; 00090 }; 00091 00093 std::ostream & operator<<( std::ostream & str, const PluginExecutor & obj ); 00094 00096 inline bool operator==( const PluginExecutor & lhs, const PluginExecutor & rhs ) 00097 { return ( lhs._pimpl == rhs._pimpl ); } 00098 00100 inline bool operator!=( const PluginExecutor & lhs, const PluginExecutor & rhs ) 00101 { return( ! operator==( lhs, rhs ) ); } 00102 00103 } // namespace zypp 00105 #endif // ZYPP_PLUGINEXECUTOR_H