Backend.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_STORAGE_BACKEND_H
00013 #define ZYPP_STORAGE_BACKEND_H
00014 
00015 #include <iosfwd>
00016 
00017 #include "zypp/base/PtrTypes.h"
00018 #include <zypp/Pathname.h>
00019 #include <zypp/Patch.h>
00020 
00021 #include <zypp/target/store/PersistentStorage.h>
00022 
00024 namespace zypp
00025 { 
00026 
00027 namespace storage
00028 { 
00029 
00031 //
00032 //      CLASS NAME : Backend
00033 //
00037 class Backend
00038 {
00039   friend std::ostream & operator<<( std::ostream & str, const Backend & obj );
00040 public:
00042   Backend(const Pathname &root);
00044   virtual ~Backend();
00045   virtual void doTest() = 0;
00046 
00050   virtual bool isBackendInitialized() const = 0;
00054   virtual void initBackend() = 0;
00055 
00059   virtual void storeObject( ResObject::constPtr resolvable )  = 0;
00063   virtual void deleteObject( ResObject::constPtr resolvable ) = 0;
00064 
00068   virtual std::list<ResObject::Ptr> storedObjects() const = 0;
00072   virtual std::list<ResObject::Ptr> storedObjects(const Resolvable::Kind) const = 0;
00077   virtual std::list<ResObject::Ptr> storedObjects(const Resolvable::Kind, const std::string & name, bool partial_match = false) const = 0;
00078 
00080   // Resolvables Flags API
00082   public:
00083   virtual void setObjectFlag( ResObject::constPtr resolvable, const std::string &flag ) = 0;
00084   virtual void removeObjectFlag( ResObject::constPtr resolvable, const std::string &flag ) = 0;
00085   virtual std::set<std::string> objectFlags( ResObject::constPtr resolvable ) const = 0;
00086   virtual bool doesObjectHasFlag( ResObject::constPtr resolvable, const std::string &flag ) const = 0;
00087 
00089   // Named Flags API
00091   public:
00092   virtual void setFlag( const std::string &key, const std::string &flag ) = 0;
00093   virtual void removeFlag( const std::string &key, const std::string &flag ) = 0;
00094   virtual std::set<std::string> flags( const std::string &key ) const = 0;
00095   virtual bool hasFlag( const std::string &key, const std::string &flag ) const = 0;
00096 
00098   // SOURCES API
00100 
00103   virtual std::list<PersistentStorage::SourceData> storedSources() const = 0;
00107   virtual void storeSource(const PersistentStorage::SourceData &data) = 0;
00111   virtual void deleteSource(const std::string &alias) = 0;
00112 
00113 private:
00115   class Private;
00116   Private *d;
00117 };
00119 
00121 std::ostream & operator<<( std::ostream & str, const Backend & obj );
00122 
00124 } // namespace storage
00127 } // namespace zypp
00129 #endif // DEVEL_DEVEL_DMACVICAR_BACKEND_H

Generated on Thu Jul 6 00:07:26 2006 for zypp by  doxygen 1.4.6