libzypp
12.16.5
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
libzypp
Welcome to libzypp
Code Pitfalls - Frequently made mistakes
Code Snippets
Environment Variables
Testing for provided features.
Notes on revisions
Extending ZYpp: Plugins and Hooks
Services
Solver - Vendor protection
Writing and tunning testcases
Libzypp and threads
User data as transaction id
Todo List
Deprecated List
Modules
Namespaces
Classes
Files
File List
zypp
base
media
misc
parser
pool
repo
sat
solver
target
hal
modalias
rpm
CommitPackageCache.cc
CommitPackageCache.h
CommitPackageCacheImpl.cc
CommitPackageCacheImpl.h
CommitPackageCacheReadAhead.cc
CommitPackageCacheReadAhead.h
HardLocksFile.cc
HardLocksFile.h
RequestedLocalesFile.cc
RequestedLocalesFile.h
SoftLocksFile.cc
SoftLocksFile.h
TargetCallbackReceiver.cc
TargetCallbackReceiver.h
TargetException.cc
TargetException.h
TargetImpl.cc
TargetImpl.h
thread
ui
url
ws
zypp_detail
APIConfig.h
Arch.cc
Arch.h
AutoDispose.h
Bit.h
ByteCount.cc
ByteCount.h
Callback.h
Capabilities.cc
Capabilities.h
Capability.cc
Capability.h
CapMatch.cc
CapMatch.h
Changelog.cc
Changelog.h
CheckSum.cc
CheckSum.h
CountryCode.cc
CountryCode.h
Date.cc
Date.h
Dep.cc
Dep.h
Digest.cc
Digest.h
DiskUsage.cc
DiskUsage.h
DiskUsageCounter.cc
DiskUsageCounter.h
DownloadMode.cc
DownloadMode.h
Edition.cc
Edition.h
ExternalProgram.cc
ExternalProgram.h
Fetcher.cc
Fetcher.h
FileChecker.cc
FileChecker.h
Filter.h
Glob.cc
Glob.h
HistoryLog.cc
HistoryLog.h
HistoryLogData.cc
HistoryLogData.h
IdString.cc
IdString.h
IdStringType.h
InstanceId.cc
InstanceId.h
KeyContext.h
KeyRing.cc
KeyRing.h
KVMap.h
LanguageCode.cc
LanguageCode.h
Locale.cc
Locale.h
Locks.cc
Locks.h
ManagedFile.h
MediaProducts.cc
MediaProducts.h
MediaSetAccess.cc
MediaSetAccess.h
Misc.h
OnMediaLocation.cc
OnMediaLocation.h
Package.cc
Package.h
PackageKeyword.h
Patch.cc
Patch.h
PathInfo.cc
PathInfo.h
Pathname.cc
Pathname.h
Pattern.cc
Pattern.h
PluginFrame.cc
PluginFrame.h
PluginFrameException.cc
PluginFrameException.h
PluginScript.cc
PluginScript.h
PluginScriptException.cc
PluginScriptException.h
PoolItem.cc
PoolItem.h
PoolItemBest.cc
PoolItemBest.h
PoolQuery.cc
PoolQuery.h
PoolQueryResult.cc
PoolQueryResult.h
PoolQueryUtil.tcc
ProblemSolution.cc
ProblemSolution.h
ProblemTypes.h
Product.cc
Product.h
ProgressData.cc
ProgressData.h
ProvideFilePolicy.cc
ProvideFilePolicy.h
PublicKey.cc
PublicKey.h
Range.cc
Range.h
Rel.cc
Rel.h
RelCompare.h
RepoInfo.cc
RepoInfo.h
RepoManager.cc
RepoManager.h
Repository.cc
Repository.h
RepoStatus.cc
RepoStatus.h
ResFilters.h
ResKind.cc
ResKind.h
ResObject.cc
ResObject.h
ResObjects.h
Resolvable.cc
Resolvable.h
Resolver.cc
Resolver.h
ResolverProblem.cc
ResolverProblem.h
ResPool.cc
ResPool.h
ResPoolProxy.cc
ResPoolProxy.h
ResStatus.cc
ResStatus.h
ResTraits.h
ServiceInfo.cc
ServiceInfo.h
Signature.cc
Signature.h
SrcPackage.cc
SrcPackage.h
SysContent.cc
SysContent.h
Target.cc
Target.h
TmpPath.cc
TmpPath.h
TriBool.h
Url.cc
Url.h
Vendor.h
VendorAttr.cc
VendorAttr.h
VendorSupportOptions.cc
VendorSupportOptions.h
ZConfig.cc
ZConfig.h
ZYpp.cc
ZYpp.h
ZYppCallbacks.h
ZYppCommit.h
ZYppCommitPolicy.cc
ZYppCommitPolicy.h
ZYppCommitResult.cc
ZYppCommitResult.h
ZYppFactory.cc
ZYppFactory.h
File Members
HardLocksFile.h
Go to the documentation of this file.
1
/*---------------------------------------------------------------------\
2
| ____ _ __ __ ___ |
3
| |__ / \ / / . \ . \ |
4
| / / \ V /| _/ _/ |
5
| / /__ | | | | | | |
6
| /_____||_| |_| |_| |
7
| |
8
\---------------------------------------------------------------------*/
12
#ifndef ZYPP_TARGET_HARDLOCKSFILE_H
13
#define ZYPP_TARGET_HARDLOCKSFILE_H
14
15
#include <iosfwd>
16
17
#include "
zypp/base/PtrTypes.h
"
18
19
#include "
zypp/Pathname.h
"
20
#include "
zypp/pool/PoolTraits.h
"
21
#include "
zypp/PoolQuery.h
"
22
24
namespace
zypp
25
{
26
27
namespace
target
28
{
29
31
//
32
// CLASS NAME : HardLocksFile
33
//
36
class
HardLocksFile
37
{
38
friend
std::ostream &
operator<<
( std::ostream & str,
const
HardLocksFile
& obj );
39
public
:
40
41
typedef
pool::PoolTraits::HardLockQueries
Data
;
42
43
public
:
45
HardLocksFile
(
const
Pathname & file_r )
46
:
_file
( file_r )
47
{}
48
50
const
Pathname &
file
()
const
51
{
return
_file
; }
52
57
const
Data
&
data
()
const
58
{
59
if
( !
_dataPtr
)
60
{
61
_dataPtr
.reset(
new
Data
);
62
Data
& mydata( *
_dataPtr
);
63
load
(
_file
, mydata );
64
}
65
return
*
_dataPtr
;
66
}
67
73
void
setData
(
const
Data
& data_r )
74
{
75
if
( !
_dataPtr
)
76
_dataPtr
.reset(
new
Data
);
77
78
if
(
differs
( *
_dataPtr
, data_r ) )
79
{
80
store
(
_file
, data_r );
81
*
_dataPtr
= data_r;
82
}
83
}
84
85
private
:
87
bool
differs
(
const
Data
& lhs,
const
Data
& rhs )
const
88
{
89
if
( lhs.size() != rhs.size() )
90
return
true
;
91
// Complete diff is too expensive and not necessary here.
92
// Just check for the same sequence of items.
93
Data::const_iterator rit = rhs.begin();
94
for_
( it, lhs.begin(), lhs.end() )
95
{
96
if
( *it != *rit )
97
return
true
;
98
++rit;
99
}
100
return
false
;
101
}
103
static
void
load
(
const
Pathname & file_r,
Data
& data_r );
105
static
void
store
(
const
Pathname & file_r,
const
Data
& data_r );
106
107
private
:
108
Pathname
_file
;
109
mutable
scoped_ptr<Data>
_dataPtr
;
110
};
112
114
std::ostream &
operator<<
( std::ostream & str,
const
HardLocksFile
& obj );
115
117
}
// namespace target
120
}
// namespace zypp
122
#endif // ZYPP_TARGET_HARDLOCKSFILE_H
zypp
target
HardLocksFile.h
Generated by
1.8.2