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

## Public Types

typedef Container_const_iterator< VersionContainerInterface, Container, VersionContainer > | const_iterator
typedef Container_iterator< VersionContainerInterface, Container, VersionContainer > | iterator
typedef Container_const_reverse_iterator< VersionContainerInterface, Container, VersionContainer > | const_reverse_iterator
typedef Container_reverse_iterator< VersionContainerInterface, Container, VersionContainer > | reverse_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) override
template<class Cont>
void | insert (VersionContainer< Cont > const &vercont)
void | insert (const_iterator begin, const_iterator end)
bool | empty () const override
void | clear () override
size_t | size () const 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
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
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 const &other)
VersionContainerInterface & | operator= (VersionContainerInterface const &other)

## 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
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
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, VersionContainer > | GroupedFromCommandLine (pkgCacheFile &Cache, const char **cmdline, std::list< Modifier > const &mods, unsigned short const fallback, CacheSetHelper &helper)
static std::map< unsigned short, VersionContainer > | GroupedFromCommandLine (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)

## 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
static pkgCache::VerIterator | getInstalledVer (pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg, CacheSetHelper &helper)
| returns the installed version of the package

## 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.

## Member Function Documentation

## clear()

template<class Container>

void clear | ( |  | ) |

inline override virtual

Implements VersionContainerInterface.

## empty()

template<class Container>

bool empty | ( |  | ) | const

inline nodiscard override virtual

Implements VersionContainerInterface.

## FromCommandLine()

template<class Container>

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

inline static

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

  Cache | the packages and versions are in
  cmdline | Command line the versions should be extracted from
  fallback | version specification
  helper | responsible for error and message handling

## FromPackage()

template<class Container>

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

inline static

returns all versions specified for the package

Parameters

  Cache | the package and versions are in
  P | the package in question
  fallback | the version(s) you want to get
  helper | the helper used for display and error handling

## insert() [1/4]

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

inline virtual

Implements VersionContainerInterface.

## insert() [2/4]

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

inline virtual

Implements VersionContainerInterface.

## insert() [3/4]

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

inline virtual

Implements VersionContainerInterface.

## insert() [4/4]

template<class Container>

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

inline override virtual

Implements VersionContainerInterface.

## size()

template<class Container>

size_t size | ( |  | ) | const

inline nodiscard override virtual

Implements VersionContainerInterface.

## sort()

template<class Container>
template<class Compare>

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.

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

- apt-pkg/cacheset.h