paludis  Version 2.6.0
Public Member Functions | Protected Member Functions | List of all members
paludis::PackageID Class Referenceabstract

#include <package_id.hh>

+ Inheritance diagram for paludis::PackageID:

Public Member Functions

virtual void can_drop_in_memory_cache () const
 
- Public Member Functions inherited from paludis::MetadataKeyHolder
MetadataConstIterator begin_metadata () const PALUDIS_ATTRIBUTE((warn_unused_result))
 
MetadataConstIterator end_metadata () const PALUDIS_ATTRIBUTE((warn_unused_result))
 
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
 

Basic operations

 PackageID ()
 
virtual ~PackageID ()=0
 
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 MetadataTimeKeyinstalled_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 Contentscontents () 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))
 
bool masked () const PALUDIS_ATTRIBUTE((warn_unused_result))
 

Overridden masks

Since
0.34
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))
 

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

- Public Types inherited from paludis::MetadataKeyHolder
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:

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 PackageID instance may support certain actions, which are represented via an Action subclass instance.

Member Function Documentation

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

Add a new Mask.

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

Add a new OverriddenMask.

Since
0.34
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.

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.

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.

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

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

bool paludis::PackageID::masked ( ) const

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

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

What is our package name?

Use canonical_form instead for outputting.

Implemented in paludis::FakePackageID.

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.

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

Perform the specified action.

Implemented in paludis::FakePackageID.

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.

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

What is our owning repository?

Since
0.58

Implemented in paludis::FakePackageID.

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.

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.

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.

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.

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.

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

What is our package version?

Use canonical_form instead for outputting.

Implemented in paludis::FakePackageID.


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