paludis Version 3.0.2
The one true package mangler
paludis::PackageID Class Referenceabstract

#include <package_id.hh>

Inheritance diagram for paludis::PackageID:

Public Member Functions

virtual void can_drop_in_memory_cache () const
MetadataConstIterator begin_metadata () const PALUDIS_ATTRIBUTE((warn_unused_result))
MetadataConstIterator end_metadata () const PALUDIS_ATTRIBUTE((warn_unused_result))
IteratorRange< MetadataConstIterator > metadata () const
MetadataConstIterator find_metadata (const std::string &) const PALUDIS_ATTRIBUTE((warn_unused_result))

Protected Member Functions

virtual void add_mask (const std::shared_ptr< const Mask > &) const
virtual void add_overridden_mask (const std::shared_ptr< const OverriddenMask > &) const
virtual void need_masks_added () const =0
Protected Member Functions inherited from paludis::MetadataKeyHolder
virtual void add_metadata_key (const std::shared_ptr< const MetadataKey > &) const
virtual void clear_metadata_keys () const
virtual void need_keys_added () const =0

Masks

typedef WrappedForwardIterator< MasksConstIteratorTag, const std::shared_ptr< const Mask > > MasksConstIterator
MasksConstIterator begin_masks () const PALUDIS_ATTRIBUTE((warn_unused_result))
MasksConstIterator end_masks () const PALUDIS_ATTRIBUTE((warn_unused_result))
IteratorRange< MasksConstIterator > masks () const
bool masked () const PALUDIS_ATTRIBUTE((warn_unused_result))

Overridden masks

typedef WrappedForwardIterator< OverriddenMasksConstIteratorTag, const std::shared_ptr< const OverriddenMask > > OverriddenMasksConstIterator
OverriddenMasksConstIterator begin_overridden_masks () const PALUDIS_ATTRIBUTE((warn_unused_result))
OverriddenMasksConstIterator end_overridden_masks () const PALUDIS_ATTRIBUTE((warn_unused_result))
IteratorRange< OverriddenMasksConstIterator > overridden_masks () const

Basic operations

std::size_t hash () const PALUDIS_ATTRIBUTE((warn_unused_result))

Name related operations

virtual const std::string canonical_form (const PackageIDCanonicalForm) const =0
virtual const QualifiedPackageName name () const =0
virtual const VersionSpec version () const =0
virtual const RepositoryName repository_name () const =0
virtual PackageDepSpec uniquely_identifying_spec () const =0

Specific metadata keys

virtual const std::shared_ptr< const MetadataValueKey< Slot > > slot_key () const =0
virtual const std::shared_ptr< const MetadataCollectionKey< KeywordNameSet > > keywords_key () const =0
virtual const std::shared_ptr< const MetadataSpecTreeKey< DependencySpecTree > > dependencies_key () const =0
virtual const std::shared_ptr< const MetadataSpecTreeKey< DependencySpecTree > > build_dependencies_key () const =0
virtual const std::shared_ptr< const MetadataSpecTreeKey< DependencySpecTree > > run_dependencies_key () const =0
virtual const std::shared_ptr< const MetadataSpecTreeKey< DependencySpecTree > > post_dependencies_key () const =0
virtual const std::shared_ptr< const MetadataSpecTreeKey< FetchableURISpecTree > > fetches_key () const =0
virtual const std::shared_ptr< const MetadataSpecTreeKey< SimpleURISpecTree > > homepage_key () const =0
virtual const std::shared_ptr< const MetadataValueKey< std::string > > short_description_key () const =0
virtual const std::shared_ptr< const MetadataValueKey< std::string > > long_description_key () const =0
virtual const std::shared_ptr< const MetadataTimeKey > installed_time_key () const =0
virtual const std::shared_ptr< const MetadataCollectionKey< Set< std::string > > > from_repositories_key () const =0
virtual const std::shared_ptr< const MetadataValueKey< FSPath > > fs_location_key () const =0
virtual const std::shared_ptr< const MetadataValueKey< std::shared_ptr< const Choices > > > choices_key () const =0
virtual const std::shared_ptr< const MetadataCollectionKey< Set< std::string > > > behaviours_key () const =0

Actions

virtual bool supports_action (const SupportsActionTestBase &) const PALUDIS_ATTRIBUTE((warn_unused_result))=0
virtual void perform_action (Action &) const =0
virtual const std::shared_ptr< const Contents > contents () const =0

Extra comparisons

virtual bool arbitrary_less_than_comparison (const PackageID &) const PALUDIS_ATTRIBUTE((warn_unused_result))=0
virtual std::size_t extra_hash_value () const PALUDIS_ATTRIBUTE((warn_unused_result))=0

Additional Inherited Members

typedef WrappedForwardIterator< MetadataConstIteratorTag, const std::shared_ptr< const MetadataKey > > MetadataConstIterator

Detailed Description

A PackageID represents a unique package version in a particular Repository.

All PackageID instances have some basic identification data:

  • A name
  • A version
  • An owning repository

It should be noted that the above together are not sufficient to uniquely identify a package. Some repositories support multiple slots per version of a package, and some repositories support additional affixes that prevent a package from being uniquely identifiable merely by the above.

PackageID instances also have:

  • A collection of metadata keys. Some of these keys have a particular specific role in certain places. These can be fetched via blah_key() methods, all of which may return an empty pointer. Other keys have no meaningful global role, and can only be fetched using the iteration methods.
  • A collection (often empty) of masks. A masked package cannot be installed.

A PackageID instance may support certain actions, which are represented via an Action subclass instance.

Member Function Documentation

◆ add_mask()

virtual void paludis::PackageID::add_mask ( const std::shared_ptr< const Mask > & ) const
protectedvirtual

Add a new Mask.

◆ add_overridden_mask()

virtual void paludis::PackageID::add_overridden_mask ( const std::shared_ptr< const OverriddenMask > & ) const
protectedvirtual

Add a new OverriddenMask.

Since
0.34

◆ arbitrary_less_than_comparison()

virtual bool paludis::PackageID::arbitrary_less_than_comparison ( const PackageID & ) const
pure virtual

Perform an arbitrary less than comparison on another PackageID.

Used by PackageIDSetComparator and operator==. This function should not be used by anything else.

This function will only be called if the other PackageID has the same name, version and repository as this. If this is not enough to uniquely identify an ID (e.g. if there is an affix, or if multiple slots per version are allowed), then this function's implementation must differentiate appropriately.

Implemented in paludis::FakePackageID.

References arbitrary_less_than_comparison(), and PALUDIS_ATTRIBUTE.

Referenced by arbitrary_less_than_comparison().

◆ behaviours_key()

virtual const std::shared_ptr< const MetadataCollectionKey< Set< std::string > > > paludis::PackageID::behaviours_key ( ) const
pure virtual

The behaviours_key may contain strings indicating that the PackageID behaves in a particular way.

Strings with recognised meanings currently are:

  • "transient", saying that an installed ID's origin is expected not to exist
  • "used", saying that an installed ID should not be treated as unused
  • "unbinaryable", saying that we should be excluded from requests to create a binary
  • "unchrootable", saying that we should be excluded from requests to install to a chroot
  • "binary", saying that we are already a binary package
Since
0.48

Implemented in paludis::FakePackageID.

References behaviours_key().

Referenced by behaviours_key().

◆ build_dependencies_key()

virtual const std::shared_ptr< const MetadataSpecTreeKey< DependencySpecTree > > paludis::PackageID::build_dependencies_key ( ) const
pure virtual

The build_dependencies_key, if non-zero, indicates a package's build-time dependencies.

Implemented in paludis::FakePackageID.

References build_dependencies_key().

Referenced by build_dependencies_key().

◆ can_drop_in_memory_cache()

virtual void paludis::PackageID::can_drop_in_memory_cache ( ) const
virtual

Allow the PackageID to drop any memory-cached metadata it holds.

Since
0.42

References can_drop_in_memory_cache().

Referenced by can_drop_in_memory_cache().

◆ canonical_form()

virtual const std::string paludis::PackageID::canonical_form ( const PackageIDCanonicalForm ) const
pure virtual

Return our canonical string representation.

This method (which is called by paludis::stringify()) should be used when outputting a PackageID or a PackageID's version. Some repositories need to display additional information to identify a package, so outputting merely the name and / or version may be insufficient.

Implemented in paludis::FakePackageID.

References canonical_form().

Referenced by canonical_form().

◆ choices_key()

virtual const std::shared_ptr< const MetadataValueKey< std::shared_ptr< const Choices > > > paludis::PackageID::choices_key ( ) const
pure virtual

The choices_key, if non-zero, contains zero or more MetadataValueKey<std::shared_ptr<const Choice> > child keys holding choice information for this ID.

Implemented in paludis::FakePackageID.

References choices_key().

Referenced by choices_key().

◆ contents()

virtual const std::shared_ptr< const Contents > paludis::PackageID::contents ( ) const
pure virtual

The contents, if non-zero, contains the contents of a package. For installed packages, this means the files installed; for installable packages, this means the files that will be installed (if known, which it may be for some binary packages).

Since
0.66

Implemented in paludis::FakePackageID.

References contents(), and PALUDIS_ATTRIBUTE.

Referenced by contents().

◆ dependencies_key()

virtual const std::shared_ptr< const MetadataSpecTreeKey< DependencySpecTree > > paludis::PackageID::dependencies_key ( ) const
pure virtual

The dependencies_key, if non-zero, provides all of a package's dependencies.

If dependencies_key is used, the client should ignore build_dependencies_key, run_dependencies_key and post_dependencies_key.

Repositories that support this key must also provide the old split out keys.

Since
0.41

Implemented in paludis::FakePackageID.

References dependencies_key().

Referenced by dependencies_key().

◆ extra_hash_value()

virtual std::size_t paludis::PackageID::extra_hash_value ( ) const
pure virtual

Provide any additional hash information for a PackageID.

The standard PackageID hash incorporates the repository name, the package name and the version of the package. If this function is defined, its value is also used when determining a hash. This can provide increased performance if a repository uses affixes or multiple slots per version.

Implemented in paludis::FakePackageID.

References extra_hash_value(), and PALUDIS_ATTRIBUTE.

Referenced by extra_hash_value().

◆ fetches_key()

virtual const std::shared_ptr< const MetadataSpecTreeKey< FetchableURISpecTree > > paludis::PackageID::fetches_key ( ) const
pure virtual

The fetches_key, if non-zero, indicates files that have to be fetched in order to install a package.

Implemented in paludis::FakePackageID.

References fetches_key().

Referenced by fetches_key().

◆ from_repositories_key()

virtual const std::shared_ptr< const MetadataCollectionKey< Set< std::string > > > paludis::PackageID::from_repositories_key ( ) const
pure virtual

The from_repositories key, if non-zero, contains the set of repositories that the ID is 'from'. An ID can be 'from' multiple repositories if, for example, it was built via a binary package.

Implemented in paludis::FakePackageID.

References from_repositories_key().

Referenced by from_repositories_key().

◆ fs_location_key()

virtual const std::shared_ptr< const MetadataValueKey< FSPath > > paludis::PackageID::fs_location_key ( ) const
pure virtual

The fs_location_key, if non-zero, indicates the filesystem location (for example, the ebuild file or VDB directory) that best describes the location of a PackageID.

Implemented in paludis::FakePackageID.

References fs_location_key().

Referenced by fs_location_key().

◆ homepage_key()

virtual const std::shared_ptr< const MetadataSpecTreeKey< SimpleURISpecTree > > paludis::PackageID::homepage_key ( ) const
pure virtual

The homepage_key, if non-zero, describes a package's homepages.

Implemented in paludis::FakePackageID.

References homepage_key().

Referenced by homepage_key().

◆ installed_time_key()

virtual const std::shared_ptr< const MetadataTimeKey > paludis::PackageID::installed_time_key ( ) const
pure virtual

The installed_time_key, if non-zero, contains the time a package was installed. It affects dependency resolution if DepList is using dl_reinstall_scm_daily or dl_reinstall_scm_weekly.

Implemented in paludis::FakePackageID.

References installed_time_key().

Referenced by installed_time_key().

◆ keywords_key()

virtual const std::shared_ptr< const MetadataCollectionKey< KeywordNameSet > > paludis::PackageID::keywords_key ( ) const
pure virtual

The keywords_key, if non-zero, is used by FindUnusedPackagesTask to determine whether a package is unused.

Implemented in paludis::FakePackageID.

References keywords_key().

Referenced by keywords_key().

◆ long_description_key()

virtual const std::shared_ptr< const MetadataValueKey< std::string > > paludis::PackageID::long_description_key ( ) const
pure virtual

The long_description_key, if non-zero, provides a long description of a package.

Implemented in paludis::FakePackageID.

References long_description_key().

Referenced by long_description_key().

◆ masked()

bool paludis::PackageID::masked ( ) const

Do we have any effective masks? Equivalent to begin_masks() != end_masks().

References masked(), and PALUDIS_ATTRIBUTE.

Referenced by masked().

◆ name()

virtual const QualifiedPackageName paludis::PackageID::name ( ) const
pure virtual

What is our package name?

Use canonical_form instead for outputting.

Implemented in paludis::FakePackageID.

References name().

Referenced by name().

◆ need_masks_added()

virtual void paludis::PackageID::need_masks_added ( ) const
protectedpure virtual

This method will be called before any of the mask iteration methods does its work. It can be used by subclasses to implement as-needed loading of masks.

Implemented in paludis::FakePackageID.

References PALUDIS_ATTRIBUTE.

◆ perform_action()

virtual void paludis::PackageID::perform_action ( Action & ) const
pure virtual

Perform the specified action.

Implemented in paludis::FakePackageID.

References perform_action().

Referenced by perform_action().

◆ post_dependencies_key()

virtual const std::shared_ptr< const MetadataSpecTreeKey< DependencySpecTree > > paludis::PackageID::post_dependencies_key ( ) const
pure virtual

The post_dependencies_key, if non-zero, indicates a package's post-merge dependencies.

Implemented in paludis::FakePackageID.

References post_dependencies_key().

Referenced by post_dependencies_key().

◆ repository_name()

virtual const RepositoryName paludis::PackageID::repository_name ( ) const
pure virtual

What is our owning repository?

Since
0.58

Implemented in paludis::FakePackageID.

References repository_name().

Referenced by repository_name().

◆ run_dependencies_key()

virtual const std::shared_ptr< const MetadataSpecTreeKey< DependencySpecTree > > paludis::PackageID::run_dependencies_key ( ) const
pure virtual

The run_dependencies_key, if non-zero, indicates a package's run-time dependencies.

Implemented in paludis::FakePackageID.

References run_dependencies_key().

Referenced by run_dependencies_key().

◆ short_description_key()

virtual const std::shared_ptr< const MetadataValueKey< std::string > > paludis::PackageID::short_description_key ( ) const
pure virtual

The short_description_key, if non-zero, provides a short (no more than a few hundred characters) description of a package.

Implemented in paludis::FakePackageID.

References short_description_key().

Referenced by short_description_key().

◆ slot_key()

virtual const std::shared_ptr< const MetadataValueKey< Slot > > paludis::PackageID::slot_key ( ) const
pure virtual

The slot, if specified, controls whether the package can be installed in parallel with other versions of the same package.

Since
0.36

Implemented in paludis::FakePackageID.

References slot_key().

Referenced by slot_key().

◆ supports_action()

virtual bool paludis::PackageID::supports_action ( const SupportsActionTestBase & ) const
pure virtual

Do we support a particular action?

Attempting to call perform_action with an unsupported action type will lead to an UnsupportedActionError. However, in performance critical code and in situations where creating a full Action subclass instance is non-trivial, supports_action is much simpler.

Implemented in paludis::FakePackageID.

References PALUDIS_ATTRIBUTE, and supports_action().

Referenced by supports_action().

◆ uniquely_identifying_spec()

virtual PackageDepSpec paludis::PackageID::uniquely_identifying_spec ( ) const
pure virtual

Return a PackageDepSpec that uniquely identifies us.

When stringified, can be turned back into an equivalent unique PackageDepSpec by using parse_user_package_dep_spec.

Since
0.36

Implemented in paludis::FakePackageID.

References uniquely_identifying_spec().

Referenced by uniquely_identifying_spec().

◆ version()

virtual const VersionSpec paludis::PackageID::version ( ) const
pure virtual

What is our package version?

Use canonical_form instead for outputting.

Implemented in paludis::FakePackageID.

References version().

Referenced by version().


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