libzypp
11.13.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
Todo List
Deprecated List
Modules
Namespaces
Classes
Files
File List
zypp
base
media
misc
parser
pool
repo
sat
detail
AttrMatcher.h
LocaleSupport.cc
LocaleSupport.h
LookupAttr.cc
LookupAttr.h
LookupAttrTools.h
Map.cc
Map.h
Pool.cc
Pool.h
Queue.cc
Queue.h
Solvable.cc
Solvable.h
SolvableSet.cc
SolvableSet.h
SolvAttr.cc
SolvAttr.h
SolvIterMixin.cc
SolvIterMixin.h
Transaction.cc
Transaction.h
WhatObsoletes.cc
WhatObsoletes.h
WhatProvides.cc
WhatProvides.h
solver
target
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
Queue.cc
Go to the documentation of this file.
1
/*---------------------------------------------------------------------\
2
| ____ _ __ __ ___ |
3
| |__ / \ / / . \ . \ |
4
| / / \ V /| _/ _/ |
5
| / /__ | | | | | | |
6
| /_____||_| |_| |_| |
7
| |
8
\---------------------------------------------------------------------*/
11
extern
"C"
12
{
13
#include <solv/queue.h>
14
}
15
#include <iostream>
16
#include "
zypp/base/LogTools.h
"
17
18
#include "
zypp/sat/Queue.h
"
19
#include "
zypp/sat/Solvable.h
"
20
21
using
std::endl;
22
24
namespace
zypp
25
{
26
27
namespace
sat
28
{
29
30
Queue::Queue
()
31
: _pimpl( new struct ::_Queue )
32
{
33
::queue_init(
_pimpl
);
34
}
35
36
Queue::~Queue
()
37
{
38
::queue_free(
_pimpl
);
39
delete
(
_pimpl
);
40
}
41
42
bool
Queue::empty
()
const
43
{
return
(
_pimpl
->count == 0 ); }
44
45
Queue::size_type
Queue::size
()
const
46
{
return
_pimpl
->count; }
47
48
Queue::const_iterator
Queue::begin
()
const
49
{
return
_pimpl
->elements; }
50
51
Queue::const_iterator
Queue::end
()
const
52
{
return
_pimpl
->elements +
_pimpl
->count;}
53
54
Queue::const_iterator
Queue::find
(
value_type
val_r )
const
55
{
56
for_
( it,
begin
(),
end
() )
57
if
( *it != val_r )
58
return
it;
59
return
end
();
60
}
61
62
Queue::value_type
Queue::first
()
const
63
{
64
if
(
empty
() )
65
return
0;
66
return
*
_pimpl
->elements;
67
}
68
69
Queue::value_type
Queue::last
()
const
70
{
71
if
(
empty
() )
72
return
0;
73
return
_pimpl
->elements[
_pimpl
->count-1];
74
}
75
76
void
Queue::clear
()
77
{ ::queue_empty( *
this
); }
78
79
void
Queue::remove
(
value_type
val_r )
80
{
81
const_iterator
it(
find
( val_r ) );
82
if
( it !=
end
() )
83
{
84
::queue_delete(
_pimpl
, it -
begin
() );
85
}
86
}
87
88
void
Queue::push
(
value_type
val_r )
89
{ ::queue_push(
_pimpl
, val_r ); }
90
91
Queue::value_type
Queue::pop
()
92
{ return ::queue_pop(
_pimpl
); }
93
94
void
Queue::push_front
(
value_type
val_r )
95
{ ::queue_unshift(
_pimpl
, val_r ); }
96
97
Queue::value_type
Queue::pop_front
()
98
{ return ::queue_shift(
_pimpl
); }
99
100
std::ostream &
operator<<
( std::ostream & str,
const
Queue
& obj )
101
{
return
dumpRangeLine
( str <<
"Queue "
, obj.
begin
(), obj.
end
() ); }
102
103
std::ostream &
dumpOn
( std::ostream & str,
const
Queue
& obj )
104
{
105
str <<
"Queue {"
;
106
if
( ! obj.
empty
() )
107
{
108
str << endl;
109
for_
( it, obj.
begin
(), obj.
end
() )
110
str <<
" "
<<
Solvable
(*it) << endl;
111
}
112
return
str <<
"}"
;
113
}
114
115
bool
operator==
(
const
Queue
& lhs,
const
Queue
& rhs )
116
{
117
const
struct ::_Queue * l = lhs;
118
const
struct ::_Queue * r = rhs;
119
return
( l == r || ( l->count == r->count && ::memcmp( l->elements, r->elements, l->count ) == 0 ) );
120
}
121
123
}
// namespace sat
126
}
// namespace zypp
zypp
sat
Queue.cc
Generated by
1.8.1