5 #ifndef EPT_CORE_SOURCE_H
6 #define EPT_CORE_SOURCE_H
11 template<
typename Self,
typename Setup,
12 template<
typename Setup::PropertyId >
class PType >
15 typedef typename Setup::Token
Token;
20 Self &
self() {
return *
static_cast< Self *
>( this ); }
22 template< PropertyId property >
23 typename PType< property >::T
get( Token t ) {
24 if ( m_cachedToken != t ) {
26 m_cached =
self().lookupToken( t );
28 return self().
template getInternal< property >( m_cached );
36 template< PropertyId _property >
37 struct ComposedList : wibble::mixin::Comparable< ComposedList< _property > >
40 typedef typename Setup::Token
Token;
41 typedef typename PType< _property >::T
Property;
51 bool empty()
const {
return internal.empty(); }
60 Token
token()
const {
return origin->getToken(
internal.
head() ); }
63 return origin->template getInternal< _property >(
67 template< PropertyId P >
68 typename PType< P >::T
70 return origin->template getInternal< P >(
internal.head() );
79 template< PropertyId property >
80 ComposedList< property >
list()
82 return ComposedList< property >(
self(),
self().listInternal() );
85 template< PropertyId P,
typename F >
94 template< PropertyId P,
typename F >
96 typedef typename list::Filtered<
100 template< PropertyId P,
typename F >
103 return list::filter( list< P >(), Propertify< P, F >( f ) );
PType< _property >::T Property
Definition: source.h:41
Token m_cachedToken
Definition: source.h:17
bool empty() const
Definition: source.h:51
Setup::Token Token
Definition: source.h:15
F f
Definition: source.h:87
Setup::InternalList internal
Definition: source.h:45
ComposedList tail() const
Definition: source.h:47
bool operator<(const ComposedList &o) const
Definition: source.h:53
Setup::Internal m_cached
Definition: source.h:18
pkgCache::VerIterator Internal
Definition: core/apt.h:362
ComposedList Type
Definition: source.h:42
PropertyFilter< P, F >::T propertyFilter(F f)
Definition: source.h:102
-*- C++ -*- (c) 2006, 2007 Petr Rockai me@mornfall.net
Definition: apt.cc:43
ComposedList()
Definition: source.h:73
Setup::PropertyId PropertyId
Definition: source.h:14
const ComposedList & head() const
Definition: source.h:58
Self Origin
Definition: source.h:39
PropertyId
Definition: core/apt.h:359
ComposedList & head()
Definition: source.h:57
Origin * origin
Definition: source.h:44
Property property() const
Definition: source.h:62
Propertify(F _f=F())
Definition: source.h:88
ComposedList(Origin &o, typename Setup::InternalList i)
Definition: source.h:75
Token token() const
Definition: source.h:60
AptInternalList< Internal > InternalList
Definition: core/apt.h:381
bool operator()(const ComposedList< P > &x) const
Definition: source.h:89
Setup::Token Token
Definition: source.h:40
ComposedList< property > list()
Definition: source.h:80
void invalidate()
Definition: source.h:31
list::Filtered< ComposedList< P >, Propertify< P, F > > T
Definition: source.h:97
Source()
Definition: source.h:106