/usr/include/x86_64-linux-gnu/zypp/Locks.h is in libzypp-dev 15.3.0-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | #ifndef ZYPP_LOCKS_H
#define ZYPP_LOCKS_H
#include "zypp/ResPool.h"
#include "zypp/Pathname.h"
#include "zypp/PoolQuery.h"
#include "zypp/ZConfig.h"
namespace zypp
{
/** \name Locks */
//@{
/**
* Singleton class which manipulate with locks file and apply locks on pool.
* for user information about locksfile and its format see
* <a>http://en.opensuse.org/Libzypp/Locksfile</a>
*/
class Locks
{
public:
typedef std::list<PoolQuery> LockList;
typedef LockList::const_iterator const_iterator;
typedef LockList::size_type size_type;
public:
class Impl;
/**
* Gets instance of this class.
* Singleton method.
*/
static Locks& instance();
const_iterator begin() const;
const_iterator end() const;
LockList::size_type size() const;
bool empty() const;
/**
* TODO add:
* toBeAdded{Begin,End,Size,Empty}
* toBeRemoved{Begin,End,Size,Empty}
*/
/**
* locks result of query and add this lock as toAdd
*/
void addLock( const PoolQuery& query );
/**
* add lock by identifier (e.g. Selectable->ident()
* and add this lock as toAdd
*/
void addLock( const IdString& ident_r );
/**
* add lock by name and kind and
* add this lock as toAdd
*/
void addLock( const ResKind& kind_r, const IdString& name_r );
/**
* add lock by name and kind and
* add this lock as toAdd
*/
void addLock( const ResKind& kind_r, const C_Str& name_r );
/**
* unlocks by result of query and add to toRemove.
*
* If unlock non-saved lock (so he is in toAdd list) then both is deleted
* and nathing happen during save
*/
void removeLock( const PoolQuery& query );
/**
* remove lock by identifier (e.g. Selectable->ident()
*
* If unlock non-saved lock (so he is in toAdd list) then both is deleted
* and nathing happen during save
*/
void removeLock( const IdString& ident_r );
/**
* remove lock by name and kind
*
* If unlock non-saved lock (so he is in toAdd list) then both is deleted
* and nathing happen during save
*/
void removeLock( const ResKind& kind_r, const IdString& name_r );
void removeLock( const ResKind& kind_r, const C_Str & name_r );
/**
* Optimalized version of read and apply.
* \see read
* \see apply
*/
void readAndApply( const Pathname& file = ZConfig::instance().locksFile() );
/**
* Read locks from file to list of stable locks (locks which is not changed
* during session)
*/
void read( const Pathname& file = ZConfig::instance().locksFile() );
/**
* Applies locks in stable list (locks which is not changed during session).
*/
void apply() const;
/**
* Merges toAdd and ToRemove list to stable list and
* save that stable list to file.
* \see SavingLocksReport
*/
void save( const Pathname& file = ZConfig::instance().locksFile() );
/**
* Merges toAdd and ToRemove list to stable list.
* \note Can call callback if problem during merging occure
* \see SavingLocksReport
*/
void merge();
/**
* Gets true if some lock doesn't lock any object in pool
* This can happen e.g. if package is removed or
* due to user bad definition of lock
*/
bool existEmpty() const;
/**
* Call callback for each empty lock.
* \see existEmpty
* \see CleanEmptyLocksReport
* \note you must call \a save to write cleaned locks to file
*/
void removeEmpty();
/**
* Delete all query duplicate in loaded locks.
* \note you must call \a save to write cleaned locks to file
*/
void removeDuplicates();
//@}
private:
Locks();
RW_pointer<Impl, rw_pointer::Scoped<Impl> > _pimpl;
};
}
#endif
|