apt  2.2.4
About: Apt (Advanced Package Tool) is a management system for software packages (Debian/Ubuntu). Release series 2.2.
  Fossies Dox: apt-2.2.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

VersionContainer< Container > Class Template Reference

#include <cacheset.h>

Inheritance diagram for VersionContainer< Container >:
[legend]
Collaboration diagram for VersionContainer< Container >:
[legend]

Public Types

typedef Container_const_iterator< VersionContainerInterface, Container, VersionContainerconst_iterator
 
typedef Container_iterator< VersionContainerInterface, Container, VersionContaineriterator
 
typedef Container_const_reverse_iterator< VersionContainerInterface, Container, VersionContainerconst_reverse_iterator
 
typedef Container_reverse_iterator< VersionContainerInterface, Container, VersionContainerreverse_iterator
 
typedef Container::value_type value_type
 
typedef Container::pointer pointer
 
typedef Container::const_pointer const_pointer
 
typedef Container::reference reference
 
typedef Container::const_reference const_reference
 
typedef Container::difference_type difference_type
 
typedef Container::size_type size_type
 
typedef Container::allocator_type allocator_type
 

Public Member Functions

bool insert (pkgCache::VerIterator const &V) APT_OVERRIDE
 
template<class Cont >
void insert (VersionContainer< Cont > const &vercont)
 
void insert (const_iterator begin, const_iterator end)
 
bool empty () const APT_OVERRIDE
 
void clear () APT_OVERRIDE
 
size_t size () const APT_OVERRIDE
 
iterator erase (iterator pos)
 
iterator erase (iterator first, iterator last)
 
const_iterator begin () const
 
const_iterator end () const
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
iterator begin ()
 
iterator end ()
 
reverse_iterator rbegin ()
 
reverse_iterator rend ()
 
const_iterator find (pkgCache::VerIterator const &V) const
 
 VersionContainer ()
 
template<typename Itr >
 VersionContainer (Itr first, Itr last)
 
void push_back (const value_type &P)
 
template<class Compare >
bool sort (Compare)
 sort all included versions with given comparer More...
 
void insert (VersionContainer< Cont > const &vercont)
 
void insert (VersionContainer< Cont > const &vercont)
 
void insert (VersionContainer< Cont > const &vercont)
 
bool insert (pkgCache::VerIterator const &V)
 
bool insert (pkgCache::VerIterator const &V)
 
bool insert (pkgCache::VerIterator const &V)
 
void insert (const_iterator begin, const_iterator end)
 
void insert (const_iterator begin, const_iterator end)
 
void insert (const_iterator begin, const_iterator end)
 
VersionContainer< std::set< pkgCache::VerIterator > >::iterator erase (iterator i)
 
VersionContainer< std::set< pkgCache::VerIterator > >::iterator erase (iterator first, iterator last)
 
bool sort (Compare Comp)
 
bool sort (Compare Comp)
 
bool sort (Compare Comp)
 
- Public Member Functions inherited from VersionContainerInterface
 VersionContainerInterface ()
 
 VersionContainerInterface (VersionContainerInterface const &other)
 
VersionContainerInterfaceoperator= (VersionContainerInterface const &other)
 
virtual ~VersionContainerInterface ()
 

Static Public Member Functions

static VersionContainer FromCommandLine (pkgCacheFile &Cache, const char **cmdline, CacheSetHelper::VerSelector const fallback, CacheSetHelper &helper)
 returns all versions specified on the commandline More...
 
static VersionContainer FromCommandLine (pkgCacheFile &Cache, const char **cmdline, CacheSetHelper::VerSelector const fallback)
 
static VersionContainer FromCommandLine (pkgCacheFile &Cache, const char **cmdline)
 
static VersionContainer FromString (pkgCacheFile &Cache, std::string const &pkg, CacheSetHelper::VerSelector const fallback, CacheSetHelper &helper, bool const)
 
static VersionContainer FromString (pkgCacheFile &Cache, std::string pkg, CacheSetHelper::VerSelector const fallback)
 
static VersionContainer FromString (pkgCacheFile &Cache, std::string pkg)
 
static VersionContainer FromPackage (pkgCacheFile &Cache, pkgCache::PkgIterator const &P, CacheSetHelper::VerSelector const fallback, CacheSetHelper &helper)
 returns all versions specified for the package More...
 
static VersionContainer FromPackage (pkgCacheFile &Cache, pkgCache::PkgIterator const &P, CacheSetHelper::VerSelector const fallback)
 
static VersionContainer FromPackage (pkgCacheFile &Cache, pkgCache::PkgIterator const &P)
 
static std::map< unsigned short, VersionContainerGroupedFromCommandLine (pkgCacheFile &Cache, const char **cmdline, std::list< Modifier > const &mods, unsigned short const fallback, CacheSetHelper &helper)
 
static std::map< unsigned short, VersionContainerGroupedFromCommandLine (pkgCacheFile &Cache, const char **cmdline, std::list< Modifier > const &mods, unsigned short const fallback)
 
static VersionContainer FromDependency (pkgCacheFile &Cache, pkgCache::DepIterator const &D, CacheSetHelper::VerSelector const selector, CacheSetHelper &helper)
 
static VersionContainer FromDependency (pkgCacheFile &Cache, pkgCache::DepIterator const &D, CacheSetHelper::VerSelector const selector)
 
static VersionContainer FromDependency (pkgCacheFile &Cache, pkgCache::DepIterator const &D)
 
- Static Public Member Functions inherited from VersionContainerInterface
static bool FromCommandLine (VersionContainerInterface *const vci, pkgCacheFile &Cache, const char **cmdline, CacheSetHelper::VerSelector const fallback, CacheSetHelper &helper)
 
static bool FromString (VersionContainerInterface *const vci, pkgCacheFile &Cache, std::string pkg, CacheSetHelper::VerSelector const fallback, CacheSetHelper &helper, bool const onlyFromName=false)
 
static bool FromPattern (VersionContainerInterface *const vci, pkgCacheFile &Cache, std::string pkg, CacheSetHelper::VerSelector const fallback, CacheSetHelper &helper)
 
static bool FromPackage (VersionContainerInterface *const vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &P, CacheSetHelper::VerSelector const fallback, CacheSetHelper &helper)
 
static bool FromModifierCommandLine (unsigned short &modID, VersionContainerInterface *const vci, pkgCacheFile &Cache, const char *cmdline, std::list< Modifier > const &mods, CacheSetHelper &helper)
 
static bool FromDependency (VersionContainerInterface *const vci, pkgCacheFile &Cache, pkgCache::DepIterator const &D, CacheSetHelper::VerSelector const selector, CacheSetHelper &helper)
 

Private Attributes

Container _cont
 

Additional Inherited Members

- Static Protected Member Functions inherited from VersionContainerInterface
static pkgCache::VerIterator getCandidateVer (pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg, CacheSetHelper &helper)
 returns the candidate version of the package More...
 
static pkgCache::VerIterator getInstalledVer (pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg, CacheSetHelper &helper)
 returns the installed version of the package More...
 

Detailed Description

template<class Container>
class APT::VersionContainer< Container >

Simple wrapper around a container class like std::set to provide a similar interface to a set of versions as to the complete set of all versions in the pkgCache.

Definition at line 790 of file cacheset.h.

Member Typedef Documentation

◆ allocator_type

typedef Container::allocator_type allocator_type

Definition at line 810 of file cacheset.h.

◆ const_iterator

◆ const_pointer

typedef Container::const_pointer const_pointer

Definition at line 805 of file cacheset.h.

◆ const_reference

typedef Container::const_reference const_reference

Definition at line 807 of file cacheset.h.

◆ const_reverse_iterator

◆ difference_type

typedef Container::difference_type difference_type

Definition at line 808 of file cacheset.h.

◆ iterator

Definition at line 800 of file cacheset.h.

◆ pointer

typedef Container::pointer pointer

Definition at line 804 of file cacheset.h.

◆ reference

typedef Container::reference reference

Definition at line 806 of file cacheset.h.

◆ reverse_iterator

◆ size_type

typedef Container::size_type size_type

Definition at line 809 of file cacheset.h.

◆ value_type

typedef Container::value_type value_type

Definition at line 803 of file cacheset.h.

Constructor & Destructor Documentation

◆ VersionContainer() [1/2]

VersionContainer ( )
inline

Definition at line 841 of file cacheset.h.

◆ VersionContainer() [2/2]

VersionContainer ( Itr  first,
Itr  last 
)
inline

Definition at line 842 of file cacheset.h.

Member Function Documentation

◆ begin() [1/2]

iterator begin ( )
inline

Definition at line 835 of file cacheset.h.

◆ begin() [2/2]

◆ clear()

void clear ( )
inlinevirtual

Implements VersionContainerInterface.

Definition at line 816 of file cacheset.h.

Referenced by DoSelection().

◆ empty()

◆ end() [1/2]

iterator end ( )
inline

Definition at line 836 of file cacheset.h.

◆ end() [2/2]

◆ erase() [1/4]

◆ erase() [2/4]

VersionContainer< std::set< pkgCache::VerIterator > >::iterator erase ( iterator  first,
iterator  last 
)
inline

Definition at line 1033 of file cacheset.h.

References VersionContainer< Container >::erase().

◆ erase() [3/4]

◆ erase() [4/4]

◆ find()

const_iterator find ( pkgCache::VerIterator const &  V) const
inline

Definition at line 839 of file cacheset.h.

Referenced by PkgIsExtraInstalled::operator()().

◆ FromCommandLine() [1/3]

static VersionContainer FromCommandLine ( pkgCacheFile Cache,
const char **  cmdline 
)
inlinestatic

Definition at line 881 of file cacheset.h.

References CacheSetHelper::CANDINST.

◆ FromCommandLine() [2/3]

static VersionContainer FromCommandLine ( pkgCacheFile Cache,
const char **  cmdline,
CacheSetHelper::VerSelector const  fallback 
)
inlinestatic

Definition at line 876 of file cacheset.h.

◆ FromCommandLine() [3/3]

static VersionContainer FromCommandLine ( pkgCacheFile Cache,
const char **  cmdline,
CacheSetHelper::VerSelector const  fallback,
CacheSetHelper helper 
)
inlinestatic

returns all versions specified on the commandline

Get all versions from the commandline, uses given default version if non specifically requested and executes regex's if needed on names.

Parameters
Cachethe packages and versions are in
cmdlineCommand line the versions should be extracted from
fallbackversion specification
helperresponsible for error and message handling

Definition at line 870 of file cacheset.h.

References VersionContainerInterface::FromCommandLine().

Referenced by DoChangelog(), DoDownload(), ShowDepends(), and UnMet().

◆ FromDependency() [1/3]

static VersionContainer FromDependency ( pkgCacheFile Cache,
pkgCache::DepIterator const &  D 
)
inlinestatic

Definition at line 958 of file cacheset.h.

References CacheSetHelper::CANDIDATE.

◆ FromDependency() [2/3]

static VersionContainer FromDependency ( pkgCacheFile Cache,
pkgCache::DepIterator const &  D,
CacheSetHelper::VerSelector const  selector 
)
inlinestatic

Definition at line 953 of file cacheset.h.

◆ FromDependency() [3/3]

static VersionContainer FromDependency ( pkgCacheFile Cache,
pkgCache::DepIterator const &  D,
CacheSetHelper::VerSelector const  selector,
CacheSetHelper helper 
)
inlinestatic

◆ FromPackage() [1/3]

static VersionContainer FromPackage ( pkgCacheFile Cache,
pkgCache::PkgIterator const &  P 
)
inlinestatic

Definition at line 918 of file cacheset.h.

References CacheSetHelper::CANDIDATE.

◆ FromPackage() [2/3]

static VersionContainer FromPackage ( pkgCacheFile Cache,
pkgCache::PkgIterator const &  P,
CacheSetHelper::VerSelector const  fallback 
)
inlinestatic

Definition at line 913 of file cacheset.h.

◆ FromPackage() [3/3]

static VersionContainer FromPackage ( pkgCacheFile Cache,
pkgCache::PkgIterator const &  P,
CacheSetHelper::VerSelector const  fallback,
CacheSetHelper helper 
)
inlinestatic

returns all versions specified for the package

Parameters
Cachethe package and versions are in
Pthe package in question
fallbackthe version(s) you want to get
helperthe helper used for display and error handling

Definition at line 907 of file cacheset.h.

References VersionContainerInterface::FromPackage().

Referenced by ShowDepends(), and CacheSetHelperAPTGet::tryVirtualPackage().

◆ FromString() [1/3]

static VersionContainer FromString ( pkgCacheFile Cache,
std::string const &  pkg,
CacheSetHelper::VerSelector const  fallback,
CacheSetHelper helper,
bool const   
)
inlinestatic

Definition at line 884 of file cacheset.h.

References VersionContainerInterface::FromString().

◆ FromString() [2/3]

static VersionContainer FromString ( pkgCacheFile Cache,
std::string  pkg 
)
inlinestatic

Definition at line 896 of file cacheset.h.

References CacheSetHelper::CANDINST.

◆ FromString() [3/3]

static VersionContainer FromString ( pkgCacheFile Cache,
std::string  pkg,
CacheSetHelper::VerSelector const  fallback 
)
inlinestatic

Definition at line 891 of file cacheset.h.

◆ GroupedFromCommandLine() [1/2]

static std::map<unsigned short, VersionContainer> GroupedFromCommandLine ( pkgCacheFile Cache,
const char **  cmdline,
std::list< Modifier > const &  mods,
unsigned short const  fallback 
)
inlinestatic

Definition at line 938 of file cacheset.h.

◆ GroupedFromCommandLine() [2/2]

static std::map<unsigned short, VersionContainer> GroupedFromCommandLine ( pkgCacheFile Cache,
const char **  cmdline,
std::list< Modifier > const &  mods,
unsigned short const  fallback,
CacheSetHelper helper 
)
inlinestatic

◆ insert() [1/12]

void insert ( const_iterator  begin,
const_iterator  end 
)
inline

Definition at line 814 of file cacheset.h.

◆ insert() [2/12]

void insert ( const_iterator  begin,
const_iterator  end 
)
inline

Definition at line 1010 of file cacheset.h.

References VersionContainer< Container >::push_back().

◆ insert() [3/12]

void insert ( const_iterator  begin,
const_iterator  end 
)
inline

Definition at line 1020 of file cacheset.h.

References VersionContainer< Container >::push_back().

◆ insert() [4/12]

void insert ( const_iterator  begin,
const_iterator  end 
)
inline

Definition at line 1024 of file cacheset.h.

References VersionContainer< Container >::push_back().

◆ insert() [5/12]

bool insert ( pkgCache::VerIterator const &  V)
inlinevirtual

Implements VersionContainerInterface.

Definition at line 984 of file cacheset.h.

References VersionContainer< Container >::push_back().

◆ insert() [6/12]

bool insert ( pkgCache::VerIterator const &  V)
inlinevirtual

Implements VersionContainerInterface.

Definition at line 998 of file cacheset.h.

References VersionContainer< Container >::push_back().

◆ insert() [7/12]

bool insert ( pkgCache::VerIterator const &  V)
inlinevirtual

Implements VersionContainerInterface.

Definition at line 1004 of file cacheset.h.

References VersionContainer< Container >::push_back().

◆ insert() [8/12]

bool insert ( pkgCache::VerIterator const &  V)
inlinevirtual

Implements VersionContainerInterface.

Definition at line 812 of file cacheset.h.

Referenced by ShowDepends().

◆ insert() [9/12]

void insert ( VersionContainer< Cont > const &  vercont)
inline

◆ insert() [10/12]

◆ insert() [11/12]

◆ insert() [12/12]

◆ push_back()

void push_back ( const value_type P)
inline

Definition at line 848 of file cacheset.h.

Referenced by VersionContainer< Container >::insert().

◆ rbegin() [1/2]

reverse_iterator rbegin ( )
inline

Definition at line 837 of file cacheset.h.

◆ rbegin() [2/2]

const_reverse_iterator rbegin ( ) const
inline

Definition at line 827 of file cacheset.h.

◆ rend() [1/2]

reverse_iterator rend ( )
inline

Definition at line 838 of file cacheset.h.

◆ rend() [2/2]

const_reverse_iterator rend ( ) const
inline

Definition at line 828 of file cacheset.h.

◆ size()

size_t size ( ) const
inlinevirtual

◆ sort() [1/4]

bool sort ( Compare  Comp)
inline

Definition at line 1038 of file cacheset.h.

◆ sort() [2/4]

bool sort ( Compare  Comp)
inline

Definition at line 1042 of file cacheset.h.

References VersionContainer< Container >::sort().

◆ sort() [3/4]

bool sort ( Compare  Comp)
inline

Definition at line 1052 of file cacheset.h.

◆ sort() [4/4]

bool sort ( Compare  )
inline

sort all included versions with given comparer

Some containers are sorted by default, some are not and can't be, but a few like std::vector can be sorted if need be, so this can be specialized in later on. The default is that this will fail though. Specifically, already sorted containers like std::set will return false as well as there is no easy way to check that the given comparer would sort in the same way the set is currently sorted

Returns
true if the set was sorted, false if not.

Definition at line 860 of file cacheset.h.

Referenced by VersionContainer< Container >::sort().

Member Data Documentation

◆ _cont

Container _cont
private

Definition at line 796 of file cacheset.h.


The documentation for this class was generated from the following file: