diff options
32 files changed, 1143 insertions, 78 deletions
diff --git a/configure.ac b/configure.ac index 68c42cddf..8c7ce1350 100644 --- a/configure.ac +++ b/configure.ac @@ -1120,7 +1120,6 @@ AC_OUTPUT( hooks/Makefile hooks/demos/Makefile misc/Makefile - misc/svn-version-filter-data.bash paludis/Makefile paludis/about.hh paludis/args/Makefile diff --git a/doc/doc_main.doxygen b/doc/doc_main.doxygen index 68c98dc56..c48e0a33b 100644 --- a/doc/doc_main.doxygen +++ b/doc/doc_main.doxygen @@ -63,6 +63,16 @@ * \ingroup grplibpaludis */ +/** \defgroup grpdistributions Distributions + * + * \ingroup grplibpaludis + */ + +/** \defgroup grpeapi EAPIs + * + * \ingroup grplibpaludis + */ + /** \defgroup grpenvironment Environment * * \ingroup grplibpaludis @@ -137,6 +147,11 @@ // ----- grpenvironment Subgroups ----- +/** \defgroup grpadaptedenvironment Adapted environment + * + * \ingroup grpenvironment + */ + /** \defgroup grppaludisenvironment Paludis environment * * \ingroup grpenvironment @@ -316,6 +331,16 @@ * \ingroup grplibpaludisutil */ +/** \defgroup grpclone Clone + * + * \ingroup grplibpaludisutil + */ + +/** \defgroup grpoperators Operators + * + * \ingroup grplibpaludisutil + */ + /** \defgroup grpgraph Graphs * * \ingroup grplibpaludisutil diff --git a/doc/doxygen.conf.in b/doc/doxygen.conf.in index cfee35727..b74c926a1 100644 --- a/doc/doxygen.conf.in +++ b/doc/doxygen.conf.in @@ -399,7 +399,7 @@ SHOW_DIRECTORIES = YES # provided by doxygen. Whatever the progam writes to standard output # is used as the file version. See the manual for examples. -FILE_VERSION_FILTER = "../misc/svn-version-filter.bash" +FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages @@ -408,7 +408,7 @@ FILE_VERSION_FILTER = "../misc/svn-version-filter.bash" # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. -QUIET = YES +QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank @@ -494,7 +494,7 @@ EXCLUDE_SYMLINKS = YES # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = *-sr.* # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see @@ -980,7 +980,7 @@ SEARCH_INCLUDES = YES # contain include files that are not input files but should be processed by # the preprocessor. -INCLUDE_PATH = +INCLUDE_PATH = ../ # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the @@ -997,7 +997,7 @@ INCLUDE_FILE_PATTERNS = # undefined via #undef or recursively expanded use the := operator # instead of the = operator. -PREDEFINED = DOXYGEN +PREDEFINED = DOXYGEN=1 PALUDIS_VISIBLE= # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. diff --git a/misc/Makefile.am b/misc/Makefile.am index b4fad58c9..250eea26d 100644 --- a/misc/Makefile.am +++ b/misc/Makefile.am @@ -1,7 +1,6 @@ CLEANFILES = *~ -MAINTAINERCLEANFILES = Makefile.in svn-version-filter-data.bash -EXTRA_DIST = generated-file.txt svn-version-filter.bash svn-version-filter-data.bash.in \ - do_m4.bash make_sr.bash make_se.bash +MAINTAINERCLEANFILES = Makefile.in +EXTRA_DIST = generated-file.txt do_m4.bash make_sr.bash make_se.bash built-sources : $(BUILT_SOURCES) for s in $(SUBDIRS) ; do $(MAKE) -C $$s built-sources || exit 1 ; done diff --git a/misc/svn-version-filter-data.bash.in b/misc/svn-version-filter-data.bash.in deleted file mode 100644 index 6b4b2492d..000000000 --- a/misc/svn-version-filter-data.bash.in +++ /dev/null @@ -1 +0,0 @@ -export VERSION=@VERSION@ diff --git a/misc/svn-version-filter.bash b/misc/svn-version-filter.bash deleted file mode 100755 index 38a36b74d..000000000 --- a/misc/svn-version-filter.bash +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash - -# For Doxygen. See: -# http://www.stack.nl/~dimitri/doxygen/config.html#cfg_file_version_filter - -source ${0/.bash/-data.bash} - -case $1 in - *.svn*) - echo $VERSION - ;; - - *) - case "$(basename $1 )" in - *.cc|*.hh|*.hh.in) - if type svn &>/dev/null ; then - echo -n "svn " - svn stat -v $1 | sed -n 's/^[ A-Z?\*|!]\{1,15\}/r/;s/ \{1,15\}/\/r/;s/ .*//p' - else - echo $VERSION - fi - ;; - - *) - echo $VERSION - ;; - esac - ;; -esac - diff --git a/paludis/args/man.hh b/paludis/args/man.hh index 3475873f3..395fb7c61 100644 --- a/paludis/args/man.hh +++ b/paludis/args/man.hh @@ -32,13 +32,29 @@ namespace paludis /** * Write docs to an ostream. * + * \ingroup grplibpaludisargs */ void generate_doc(DocWriter & dw, const ArgsHandler * const h) PALUDIS_VISIBLE; + /** + * Write docs from args classes in a particular format. + * + * \ingroup grplibpaludisargs + * \nosubgrouping + */ class PALUDIS_VISIBLE DocWriter { public: + ///\name Basic operations + ///\{ + virtual ~DocWriter() = 0; + + ///\} + + ///\name Output routines + ///\{ + virtual void heading(const std::string & name, const std::string & section, const std::string & synopsis) = 0; virtual void usage_line(const std::string & name, const std::string & line) = 0; @@ -62,8 +78,16 @@ namespace paludis virtual void section(const std::string & title) = 0; virtual void subsection(const std::string & title) = 0; virtual void paragraph(const std::string & text) = 0; + + ///\} }; + /** + * Create HTML documentation from args classes. + * + * \ingroup grplibpaludisargs + * \nosubgrouping + */ class PALUDIS_VISIBLE HtmlWriter : public DocWriter { @@ -71,8 +95,14 @@ namespace paludis std::ostream & _os; public: + ///\name Basic operations + ///\{ + HtmlWriter(std::ostream & os); ~HtmlWriter(); + + ///\} + void heading(const std::string & name, const std::string & section, const std::string & synopis); void usage_line(const std::string & name, const std::string & line); @@ -98,6 +128,12 @@ namespace paludis void paragraph(const std::string & text); }; + /** + * Create man documentation from args classes. + * + * \ingroup grplibpaludisargs + * \nosubgrouping + */ class PALUDIS_VISIBLE ManWriter : public DocWriter { @@ -105,8 +141,14 @@ namespace paludis std::ostream & _os; public: + ///\name Basic operations + ///\{ + ManWriter(std::ostream & os); ~ManWriter(); + + ///\} + void heading(const std::string & name, const std::string & section, const std::string & synopis); void usage_line(const std::string & name, const std::string & line); diff --git a/paludis/dep_list/query_visitor.hh b/paludis/dep_list/query_visitor.hh index 77f7ee03c..97fc07a4b 100644 --- a/paludis/dep_list/query_visitor.hh +++ b/paludis/dep_list/query_visitor.hh @@ -28,16 +28,30 @@ namespace paludis { class PackageDatabaseEntry; + /** + * Used by DepList to check for existing deps. + * + * \ingroup grpdepresolver + * \nosubgrouping + */ class QueryVisitor : public ConstVisitor<DependencySpecTree>, private PrivateImplementationPattern<QueryVisitor> { public: + ///\name Basic operations + ///\{ + QueryVisitor(const DepList * const, tr1::shared_ptr<const DestinationsCollection>, const Environment * const, const PackageDatabaseEntry * const); ~QueryVisitor(); + ///\} + + ///\name Visitor operations + ///\{ + void visit_sequence(const AllDepSpec &, DependencySpecTree::ConstSequenceIterator, DependencySpecTree::ConstSequenceIterator); @@ -54,6 +68,11 @@ namespace paludis void visit_leaf(const BlockDepSpec &); + ///\} + + /** + * Are we matched? + */ bool result() const; }; } diff --git a/paludis/dep_list/show_suggest_visitor.hh b/paludis/dep_list/show_suggest_visitor.hh index 9356a8ebf..2a96ac625 100644 --- a/paludis/dep_list/show_suggest_visitor.hh +++ b/paludis/dep_list/show_suggest_visitor.hh @@ -26,6 +26,12 @@ namespace paludis { + /** + * Used by DepList to add suggested deps. + * + * \ingroup grpdepresolver + * \nosubgrouping + */ class ShowSuggestVisitor : public ConstVisitor<DependencySpecTree>, public ConstVisitor<DependencySpecTree>::VisitConstSequence<ShowSuggestVisitor, AnyDepSpec>, @@ -33,10 +39,18 @@ namespace paludis private PrivateImplementationPattern<ShowSuggestVisitor> { public: + ///\name Basic operations + ///\{ + ShowSuggestVisitor(DepList * const dd, tr1::shared_ptr<const DestinationsCollection> ddd, const Environment * const, const PackageDatabaseEntry * const); ~ShowSuggestVisitor(); + ///\} + + ///\name Visitor operations + ///\{ + void visit_leaf(const BlockDepSpec &); void visit_leaf(const PackageDepSpec &); @@ -47,6 +61,8 @@ namespace paludis using ConstVisitor<DependencySpecTree>::VisitConstSequence<ShowSuggestVisitor, AllDepSpec>::visit_sequence; using ConstVisitor<DependencySpecTree>::VisitConstSequence<ShowSuggestVisitor, AnyDepSpec>::visit_sequence; + + ///\} }; } diff --git a/paludis/dep_spec-fwd.hh b/paludis/dep_spec-fwd.hh index 43da8cf83..c7cd2368a 100644 --- a/paludis/dep_spec-fwd.hh +++ b/paludis/dep_spec-fwd.hh @@ -54,6 +54,11 @@ namespace paludis */ std::ostream & operator<< (std::ostream &, const PackageDepSpec &) PALUDIS_VISIBLE; + /** + * A generic DepSpec heirarchy. + * + * \ingroup grpdepspecs + */ struct GenericSpecTree : VisitorTypes< GenericSpecTree, @@ -69,6 +74,11 @@ namespace paludis { }; + /** + * A DepSpec heirarchy containing things meaningful for licenses. + * + * \ingroup grpdepspecs + */ struct LicenseSpecTree : VisitorTypes< LicenseSpecTree, @@ -81,6 +91,11 @@ namespace paludis { }; + /** + * A DepSpec heirarchy containing things meaningful for URIs. + * + * \ingroup grpdepspecs + */ struct URISpecTree : VisitorTypes< URISpecTree, @@ -92,6 +107,11 @@ namespace paludis { }; + /** + * A DepSpec heirarchy containing things that can be flattened. + * + * \ingroup grpdepspecs + */ struct FlattenableSpecTree : VisitorTypes< FlattenableSpecTree, @@ -106,6 +126,11 @@ namespace paludis { }; + /** + * A DepSpec heirarchy containing things meaningful for provides. + * + * \ingroup grpdepspecs + */ struct ProvideSpecTree : VisitorTypes< ProvideSpecTree, @@ -117,6 +142,11 @@ namespace paludis { }; + /** + * A DepSpec heirarchy containing things meaningful for restricts. + * + * \ingroup grpdepspecs + */ struct RestrictSpecTree : VisitorTypes< RestrictSpecTree, @@ -128,6 +158,11 @@ namespace paludis { }; + /** + * A DepSpec heirarchy containing things meaningful for dependencies. + * + * \ingroup grpdepspecs + */ struct DependencySpecTree : VisitorTypes< DependencySpecTree, @@ -141,6 +176,11 @@ namespace paludis { }; + /** + * A DepSpec heirarchy containing things meaningful for sets. + * + * \ingroup grpdepspecs + */ struct SetSpecTree : VisitorTypes< SetSpecTree, diff --git a/paludis/distribution.hh b/paludis/distribution.hh index 61cc25ddb..1cfa95740 100644 --- a/paludis/distribution.hh +++ b/paludis/distribution.hh @@ -32,13 +32,31 @@ namespace paludis { #include <paludis/distribution-sr.hh> + /** + * Thrown if an invalid distribution file is encountered. + * + * \ingroup grpdistributions + * \ingroup grpexceptions + * \nosubgrouping + */ class PALUDIS_VISIBLE DistributionConfigurationError : public ConfigurationError { public: + ///\name Basic operations + ///\{ + DistributionConfigurationError(const std::string &) throw (); + + ///\} }; + /** + * Fetch information about a distribution. + * + * \ingroup grpdistributions + * \nosubgrouping + */ class PALUDIS_VISIBLE DistributionData : private PrivateImplementationPattern<DistributionData>, public InstantiationPolicy<DistributionData, instantiation_method::SingletonTag> @@ -50,8 +68,14 @@ namespace paludis ~DistributionData(); public: + /** + * Fetch a distribution from a named string. + */ tr1::shared_ptr<const Distribution> distribution_from_string(const std::string &) const; + /** + * Fetch the default distribution. + */ tr1::shared_ptr<const Distribution> default_distribution() const; }; } diff --git a/paludis/eapi.hh b/paludis/eapi.hh index 216928839..ce2787f92 100644 --- a/paludis/eapi.hh +++ b/paludis/eapi.hh @@ -37,7 +37,7 @@ namespace paludis * Thrown if an EAPI configuration is broken. * * \see EAPI - * \ingroup grpnames + * \ingroup grpeapi * \ingroup grpexceptions * \nosubgrouping */ @@ -52,7 +52,7 @@ namespace paludis * Holds information on recognised EAPIs. * * \see EAPI - * \ingroup grpnames + * \ingroup grpeapi * \nosubgrouping */ class PALUDIS_VISIBLE EAPIData : diff --git a/paludis/eapi.sr b/paludis/eapi.sr index 34733759f..0a5505455 100644 --- a/paludis/eapi.sr +++ b/paludis/eapi.sr @@ -14,6 +14,16 @@ make_class_EAPIEbuildPhases() key ebuild_nofetch std::string key ebuild_variable std::string key ebuild_config std::string + + doxygen_comment << "END" + /** + * Information about a supported EAPI's ebuild phases. + * + * \see EAPI + * \ingroup grpeapi + * \nosubgrouping + */ +END } make_class_EAPIEbuildMetadataVariables() @@ -36,6 +46,17 @@ make_class_EAPIEbuildMetadataVariables() key metadata_pdepend std::string key metadata_provide std::string key metadata_eapi std::string + + doxygen_comment << "END" + /** + * Information about a supported EAPI's ebuild metadata variables. + * + * \see EAPIData + * \see EAPI + * \ingroup grpeapi + * \nosubgrouping + */ +END } make_class_SupportedEAPI() @@ -66,7 +87,7 @@ make_class_SupportedEAPI() * * \see EAPIData * \see EAPI - * \ingroup grpnames + * \ingroup grpeapi * \nosubgrouping */ END @@ -86,7 +107,7 @@ make_class_EAPI() * Information about an EAPI. * * \see EAPIData - * \ingroup grpnames + * \ingroup grpeapi * \nosubgrouping */ END diff --git a/paludis/environments/paludis/keywords_conf.hh b/paludis/environments/paludis/keywords_conf.hh index 43b4efb7e..ef4adc08d 100644 --- a/paludis/environments/paludis/keywords_conf.hh +++ b/paludis/environments/paludis/keywords_conf.hh @@ -32,16 +32,33 @@ namespace paludis namespace paludis_environment { + /** + * Represents the keywords.conf file, which may be composed of multiple 'real' files. + * + * \ingroup grppaludisenvironment + * \nosubgrouping + */ class KeywordsConf : private PrivateImplementationPattern<KeywordsConf>, private InstantiationPolicy<KeywordsConf, instantiation_method::NonCopyableTag> { public: + ///\name Basic operations + ///\{ + KeywordsConf(const PaludisEnvironment * const); ~KeywordsConf(); + ///\} + + /** + * Add another file. + */ void add(const FSEntry &); + /** + * Query a collection of keywords. + */ bool query(tr1::shared_ptr<const KeywordNameCollection>, const PackageDatabaseEntry &) const; }; } diff --git a/paludis/environments/paludis/licenses_conf.hh b/paludis/environments/paludis/licenses_conf.hh index 754277deb..fa715e042 100644 --- a/paludis/environments/paludis/licenses_conf.hh +++ b/paludis/environments/paludis/licenses_conf.hh @@ -32,16 +32,33 @@ namespace paludis namespace paludis_environment { + /** + * Represents the licenses.conf file, which may be composed of multiple 'real' files. + * + * \ingroup grppaludisenvironment + * \nosubgrouping + */ class LicensesConf : private PrivateImplementationPattern<LicensesConf>, private InstantiationPolicy<LicensesConf, instantiation_method::NonCopyableTag> { public: + ///\name Basic operations + ///\{ + LicensesConf(const PaludisEnvironment * const); ~LicensesConf(); + ///\} + + /** + * Add another file. + */ void add(const FSEntry &); + /** + * Query a particular license. + */ bool query(const std::string &, const PackageDatabaseEntry &) const; }; } diff --git a/paludis/environments/paludis/mirrors_conf.hh b/paludis/environments/paludis/mirrors_conf.hh index d028e6125..729ff6998 100644 --- a/paludis/environments/paludis/mirrors_conf.hh +++ b/paludis/environments/paludis/mirrors_conf.hh @@ -33,16 +33,33 @@ namespace paludis namespace paludis_environment { + /** + * Represents the mirrors.conf file, which may be composed of multiple 'real' files. + * + * \ingroup grppaludisenvironment + * \nosubgrouping + */ class MirrorsConf : private PrivateImplementationPattern<MirrorsConf>, private InstantiationPolicy<MirrorsConf, instantiation_method::NonCopyableTag> { public: + ///\name Basic operations + ///\{ + MirrorsConf(const PaludisEnvironment * const); ~MirrorsConf(); + ///\} + + /** + * Add another file. + */ void add(const FSEntry &); + /** + * Query a mirror. + */ tr1::shared_ptr<const MirrorsCollection> query(const std::string &) const PALUDIS_ATTRIBUTE((warn_unused_result)); }; diff --git a/paludis/environments/paludis/package_mask_conf.hh b/paludis/environments/paludis/package_mask_conf.hh index 8a39792a2..571c11d5c 100644 --- a/paludis/environments/paludis/package_mask_conf.hh +++ b/paludis/environments/paludis/package_mask_conf.hh @@ -32,16 +32,34 @@ namespace paludis namespace paludis_environment { + /** + * Represents the package_mask.conf or package_unmask.conf file, which may be + * composed of multiple 'real' files. + * + * \ingroup grppaludisenvironment + * \nosubgrouping + */ class PackageMaskConf : private PrivateImplementationPattern<PackageMaskConf>, private InstantiationPolicy<PackageMaskConf, instantiation_method::NonCopyableTag> { public: + ///\name Basic operations + ///\{ + PackageMaskConf(const PaludisEnvironment * const); ~PackageMaskConf(); + ///\} + + /** + * Add another file. + */ void add(const FSEntry &); + /** + * Query a mask. + */ bool query(const PackageDatabaseEntry &) const; }; } diff --git a/paludis/environments/paludis/use_conf.hh b/paludis/environments/paludis/use_conf.hh index e220a796c..64c7024e7 100644 --- a/paludis/environments/paludis/use_conf.hh +++ b/paludis/environments/paludis/use_conf.hh @@ -32,19 +32,39 @@ namespace paludis namespace paludis_environment { + /** + * Represents the use.conf file, which may be composed of multiple 'real' files. + * + * \ingroup grppaludisenvironment + * \nosubgrouping + */ class UseConf : private PrivateImplementationPattern<UseConf>, private InstantiationPolicy<UseConf, instantiation_method::NonCopyableTag> { public: + ///\name Basic operations + ///\{ + UseConf(const PaludisEnvironment * const); ~UseConf(); + ///\} + + /** + * Add another file. + */ void add(const FSEntry &); + /** + * Query a use flag. + */ UseFlagState query(const UseFlagName &, const PackageDatabaseEntry &) const PALUDIS_ATTRIBUTE((warn_unused_result)); + /** + * Fetch the known use expand names for a prefix. + */ tr1::shared_ptr<const UseFlagNameCollection> known_use_expand_names( const UseFlagName &, const PackageDatabaseEntry &) const PALUDIS_ATTRIBUTE((warn_unused_result)); diff --git a/paludis/host_tuple_name.hh b/paludis/host_tuple_name.hh index 348208e00..fb8fbadaf 100644 --- a/paludis/host_tuple_name.hh +++ b/paludis/host_tuple_name.hh @@ -31,7 +31,6 @@ /** \file * Declarations for various Name classes. * - * \ingroup grpnames * \ingroup grphosttuplename */ @@ -41,7 +40,6 @@ namespace paludis * A HostTupleNameError is thrown if an invalid value is assigned to * an HostTupleName. * - * \ingroup grpnames * \ingroup grphosttuplename * \ingroup grpexceptions */ @@ -63,7 +61,6 @@ namespace paludis * An ArchitectureNamePartError is thrown if an invalid value is assigned to * an ArchitectureNamePart. * - * \ingroup grpnames * \ingroup grphosttuplename * \ingroup grpexceptions */ @@ -80,7 +77,6 @@ namespace paludis * An ArchitectureNamePartValidator handles validation rules for the value * of an ArchitectureNamePart. * - * \ingroup grpnames * \ingroup grphosttuplename */ struct PALUDIS_VISIBLE ArchitectureNamePartValidator : @@ -97,7 +93,6 @@ namespace paludis * An ArchitectureNamePart holds a std::string that is a valid name for the * architecture part of a HostTupleName. * - * \ingroup grpnames * \ingroup grphosttuplename */ typedef Validated<std::string, ArchitectureNamePartValidator> ArchitectureNamePart; @@ -106,7 +101,6 @@ namespace paludis * An ManufacturerNamePartError is thrown if an invalid value is assigned to * an ManufacturerNamePart. * - * \ingroup grpnames * \ingroup grphosttuplename * \ingroup grpexceptions */ @@ -123,7 +117,6 @@ namespace paludis * An ManufacturerNamePartValidator handles validation rules for the value * of an ManufacturerNamePart. * - * \ingroup grpnames * \ingroup grphosttuplename */ struct PALUDIS_VISIBLE ManufacturerNamePartValidator : @@ -140,7 +133,6 @@ namespace paludis * An ManufacturerNamePart holds a std::string that is a valid name for the * architecture part of a HostTupleName. * - * \ingroup grpnames * \ingroup grphosttuplename */ typedef Validated<std::string, ManufacturerNamePartValidator> ManufacturerNamePart; @@ -149,7 +141,6 @@ namespace paludis * An KernelNamePartError is thrown if an invalid value is assigned to * an KernelNamePart. * - * \ingroup grpnames * \ingroup grphosttuplename * \ingroup grpexceptions */ @@ -166,7 +157,6 @@ namespace paludis * An KernelNamePartValidator handles validation rules for the value * of an KernelNamePart. * - * \ingroup grpnames * \ingroup grphosttuplename */ struct PALUDIS_VISIBLE KernelNamePartValidator : @@ -183,7 +173,6 @@ namespace paludis * An KernelNamePart holds a std::string that is a valid name for the * architecture part of a HostTupleName. * - * \ingroup grpnames * \ingroup grphosttuplename */ typedef Validated<std::string, KernelNamePartValidator> KernelNamePart; @@ -192,7 +181,6 @@ namespace paludis * An UserlandNamePartError is thrown if an invalid value is assigned to * an UserlandNamePart. * - * \ingroup grpnames * \ingroup grphosttuplename * \ingroup grpexceptions */ @@ -209,7 +197,6 @@ namespace paludis * An UserlandNamePartValidator handles validation rules for the value * of an UserlandNamePart. * - * \ingroup grpnames * \ingroup grphosttuplename */ struct PALUDIS_VISIBLE UserlandNamePartValidator : @@ -226,7 +213,6 @@ namespace paludis * An UserlandNamePart holds a std::string that is a valid name for the * architecture part of a HostTupleName. * - * \ingroup grpnames * \ingroup grphosttuplename */ typedef Validated<std::string, UserlandNamePartValidator> UserlandNamePart; @@ -237,7 +223,6 @@ namespace paludis /** * Output a QualifiedPackageName to a stream. * - * \ingroup grpnames * \ingroup grphosttuplename */ std::ostream & operator<< (std::ostream &, const HostTupleName &) PALUDIS_VISIBLE; diff --git a/paludis/repositories/gems/exceptions.hh b/paludis/repositories/gems/exceptions.hh index acd6d3e77..f2ded0a10 100644 --- a/paludis/repositories/gems/exceptions.hh +++ b/paludis/repositories/gems/exceptions.hh @@ -26,11 +26,23 @@ namespace paludis { namespace gems { + /** + * Thrown if a Gems repository is misconfigured. + * + * \ingroup grpexceptions + * \ingroup grpgemsrepository + * \nosubgrouping + */ class PALUDIS_VISIBLE RepositoryConfigurationError : public ConfigurationError { public: + ///\name Basic operations + ///\{ + RepositoryConfigurationError(const std::string &) throw (); + + ///\} }; } } diff --git a/paludis/repositories/gems/gem_specification.hh b/paludis/repositories/gems/gem_specification.hh index 37ac01576..cb9cf279c 100644 --- a/paludis/repositories/gems/gem_specification.hh +++ b/paludis/repositories/gems/gem_specification.hh @@ -32,20 +32,46 @@ namespace paludis { namespace gems { + /** + * Thrown if a bad Gem specification is encountered. + * + * \ingroup grpexceptions + * \ingroup grpgemsrepository + * \nosubgrouping + */ class PALUDIS_VISIBLE BadSpecificationError : public Exception { public: + ///\name Basic operations + ///\{ + BadSpecificationError(const std::string &) throw (); + + ///\} }; + /** + * Represents a Gem specification. + * + * \ingroup grpgemsrepository + * \nosubgrouping + */ class PALUDIS_VISIBLE GemSpecification : private PrivateImplementationPattern<GemSpecification> { public: + ///\name Basic operations + ///\{ + GemSpecification(const yaml::Node &); ~GemSpecification(); + ///\} + + ///\name Specification data + ///\{ + const tr1::function<std::string ()> name; const tr1::function<std::string ()> version; const tr1::function<std::string ()> homepage; @@ -55,6 +81,8 @@ namespace paludis const tr1::function<std::string ()> platform; const tr1::function<std::string ()> summary; const tr1::function<std::string ()> description; + + ///\} }; } } diff --git a/paludis/repositories/gems/gem_specifications.hh b/paludis/repositories/gems/gem_specifications.hh index ec49c7629..79331d647 100644 --- a/paludis/repositories/gems/gem_specifications.hh +++ b/paludis/repositories/gems/gem_specifications.hh @@ -35,18 +35,35 @@ namespace paludis { namespace gems { + /** + * Represents a collection of Gem specifications held in a master yaml + * file. + * + * \ingroup grpgemsrepository + * \nosubgrouping + */ class PALUDIS_VISIBLE GemSpecifications : private PrivateImplementationPattern<GemSpecifications> { public: + ///\name Basic operations + ///\{ + GemSpecifications(const yaml::Node &); ~GemSpecifications(); + ///\} + + ///\name Iterate over our specifications + ///\{ + typedef libwrapiter::ForwardIterator<GemSpecifications, const std::pair<const std::pair<QualifiedPackageName, VersionSpec>, tr1::shared_ptr<const GemSpecification> > > Iterator; Iterator begin() const PALUDIS_ATTRIBUTE((warn_unused_result)); Iterator end() const PALUDIS_ATTRIBUTE((warn_unused_result)); + + ///\} }; } } diff --git a/paludis/repositories/gems/gems_repository.hh b/paludis/repositories/gems/gems_repository.hh index edd959e5f..403cb490b 100644 --- a/paludis/repositories/gems/gems_repository.hh +++ b/paludis/repositories/gems/gems_repository.hh @@ -26,6 +26,12 @@ namespace paludis { + /** + * Repository for Gem packages. + * + * \ingroup grpgemsrepository + * \nosubgrouping + */ class PALUDIS_VISIBLE GemsRepository : public Repository, public RepositoryInstallableInterface, diff --git a/paludis/repositories/gems/installed_gems_repository.hh b/paludis/repositories/gems/installed_gems_repository.hh index 93e743c4f..5ba7670f7 100644 --- a/paludis/repositories/gems/installed_gems_repository.hh +++ b/paludis/repositories/gems/installed_gems_repository.hh @@ -26,6 +26,12 @@ namespace paludis { + /** + * Repository for installed Gem packages. + * + * \ingroup grpgemsrepository + * \nosubgrouping + */ class PALUDIS_VISIBLE InstalledGemsRepository : public Repository, public RepositoryDestinationInterface, diff --git a/paludis/repositories/gems/metadata.hh b/paludis/repositories/gems/metadata.hh index 159d0f56e..b4c1dba1f 100644 --- a/paludis/repositories/gems/metadata.hh +++ b/paludis/repositories/gems/metadata.hh @@ -28,14 +28,25 @@ namespace paludis { namespace gems { + /** + * Version metadata for a Gem. + * + * \ingroup grpgemsrepository + * \nosubgrouping + */ class GemMetadata : public VersionMetadata, public virtual VersionMetadataHasInterfaces { public: + ///\name Basic operations + ///\{ + GemMetadata(const VersionSpec &); virtual ~GemMetadata(); + ///\} + virtual const VersionMetadata * version_metadata() const { return this; @@ -44,15 +55,26 @@ namespace paludis void populate_from_specification(const GemSpecification &); }; + /** + * Version metadata for an installed Gem. + * + * \ingroup grpgemsrepository + * \nosubgrouping + */ class InstalledGemMetadata : public VersionMetadata, public VersionMetadataOriginsInterface, public virtual VersionMetadataHasInterfaces { public: + ///\name Basic operations + ///\{ + InstalledGemMetadata(const VersionSpec &); virtual ~InstalledGemMetadata(); + ///\} + virtual const VersionMetadata * version_metadata() const { return this; diff --git a/paludis/repositories/gems/yaml.hh b/paludis/repositories/gems/yaml.hh index cebc33bb6..6e3a20ab9 100644 --- a/paludis/repositories/gems/yaml.hh +++ b/paludis/repositories/gems/yaml.hh @@ -36,6 +36,12 @@ namespace paludis class SequenceNode; class MapNode; + /** + * Visitor types for a yaml node heirarchy. + * + * \ingroup grpgemsrepository + * \nosubgrouping + */ struct NodeVisitorTypes : VisitorTypes< NodeVisitorTypes, @@ -46,68 +52,152 @@ namespace paludis { }; + /** + * A node in a yaml document. + * + * \ingroup grpgemsrepository + * \nosubgrouping + */ class PALUDIS_VISIBLE Node : public virtual ConstAcceptInterface<NodeVisitorTypes> { public: + ///\name Basic operations + ///\{ + virtual ~Node() = 0; + + ///\} }; + /** + * A string node in a yaml document. + * + * \ingroup grpgemsrepository + * \nosubgrouping + */ class PALUDIS_VISIBLE StringNode : public Node, public ConstAcceptInterfaceVisitsThis<NodeVisitorTypes, StringNode>, private PrivateImplementationPattern<StringNode> { public: + ///\name Basic operations + ///\{ + StringNode(const std::string &); ~StringNode(); + ///\} + + /** + * The node's raw text. + */ std::string text() const PALUDIS_ATTRIBUTE((warn_unused_result)); }; + /** + * A sequence node in a yaml document. + * + * \ingroup grpgemsrepository + * \nosubgrouping + */ class PALUDIS_VISIBLE SequenceNode : public Node, public ConstAcceptInterfaceVisitsThis<NodeVisitorTypes, SequenceNode>, private PrivateImplementationPattern<SequenceNode> { public: + ///\name Basic operations + ///\{ + SequenceNode(); ~SequenceNode(); + ///\} + + /** + * Add a child node. + */ void push_back(const Node * const); + ///\name Iterate over our child nodes. + ///\{ + typedef libwrapiter::ForwardIterator<SequenceNode, const Node * const> Iterator; Iterator begin() const PALUDIS_ATTRIBUTE((warn_unused_result)); Iterator end() const PALUDIS_ATTRIBUTE((warn_unused_result)); + + ///\} }; + /** + * A mapping node in a yaml document. + * + * \ingroup grpgemsrepository + * \nosubgrouping + */ class PALUDIS_VISIBLE MapNode : public Node, public ConstAcceptInterfaceVisitsThis<NodeVisitorTypes, MapNode>, private PrivateImplementationPattern<MapNode> { public: + ///\name Basic operations + ///\{ + MapNode(); ~MapNode(); + ///\} + + /** + * Add a child node pair. + */ void push_back(const std::pair<const Node *, const Node *> &); + ///\name Iterate over and find our child nodes. + ///\{ + typedef libwrapiter::ForwardIterator<MapNode, const std::pair<const Node *, const Node *> > Iterator; Iterator begin() const PALUDIS_ATTRIBUTE((warn_unused_result)); Iterator end() const PALUDIS_ATTRIBUTE((warn_unused_result)); Iterator find(const std::string &) const PALUDIS_ATTRIBUTE((warn_unused_result)); + + ///\} }; + /** + * A yaml document. + * + * \ingroup grpgemsrepository + * \nosubgrouping + */ class PALUDIS_VISIBLE Document : private PrivateImplementationPattern<Document> { public: + ///\name Basic operations + ///\{ + Document(const std::string &); ~Document(); + ///\} + + /** + * The top node in our document. + */ const Node * top() const PALUDIS_ATTRIBUTE((warn_unused_result)); }; + /** + * Handles memory management for yaml nodes, since syck assumes garbage + * collection. + * + * \ingroup grpgemsrepository + * \nosubgrouping + */ class PALUDIS_VISIBLE NodeManager : private PrivateImplementationPattern<NodeManager>, public InstantiationPolicy<NodeManager, instantiation_method::SingletonTag> @@ -115,21 +205,43 @@ namespace paludis friend class InstantiationPolicy<NodeManager, instantiation_method::SingletonTag>; private: + ///\name Basic operations + ///\{ + NodeManager(); ~NodeManager(); + ///\} + public: + ///\name Memory management operations + ///\{ + void register_document(const void * const); void deregister_document(const void * const); void manage_node(const void * const, const Node * const); + + ///\} }; + /** + * Thrown if a yaml document cannot be parsed. + * + * \ingroup grpgemsrepository + * \ingroup grpexceptions + * \nosubgrouping + */ class PALUDIS_VISIBLE ParseError : public Exception { public: + ///\name Basic operations + ///\{ + ParseError(const std::string &) throw (); + + ///\} }; } } diff --git a/paludis/repositories/gentoo/eapi_phase.hh b/paludis/repositories/gentoo/eapi_phase.hh index c350ec525..834b5a75a 100644 --- a/paludis/repositories/gentoo/eapi_phase.hh +++ b/paludis/repositories/gentoo/eapi_phase.hh @@ -28,30 +28,64 @@ namespace paludis { namespace erepository { + /** + * Holds a parsed EAPI phase. + * + * \nosubgrouping + * \ingroup grpportagerepository + * \ingroup grpeapi + */ class EAPIPhase : private PrivateImplementationPattern<EAPIPhase> { public: + ///\name Basic operations + ///\{ + explicit EAPIPhase(const std::string &); ~EAPIPhase(); + ///\} + + ///\name Information about the phase + ///\{ + bool option(const std::string &) const; typedef libwrapiter::ForwardIterator<EAPIPhase, const std::string> Iterator; Iterator begin_commands() const; Iterator end_commands() const; + + ///\} }; + /** + * Holds parsed EAPI phases. + * + * \nosubgrouping + * \ingroup grpportagerepository + * \ingroup grpeapi + */ class EAPIPhases : private PrivateImplementationPattern<EAPIPhases> { public: + ///\name Basic operations + ///\{ + explicit EAPIPhases(const std::string &); ~EAPIPhases(); + ///\} + + ///\name Information about the phases + ///\{ + typedef libwrapiter::ForwardIterator<EAPIPhases, const EAPIPhase> Iterator; Iterator begin_phases() const; Iterator end_phases() const; + + ///\} }; } } diff --git a/paludis/repositories/gentoo/layout.hh b/paludis/repositories/gentoo/layout.hh index 75ec63d2e..e7fe91d9c 100644 --- a/paludis/repositories/gentoo/layout.hh +++ b/paludis/repositories/gentoo/layout.hh @@ -34,14 +34,25 @@ namespace paludis { class PortageRepositoryEntries; + /** + * Manages the layout of a PortageRepository. + * + * \ingroup grpportagerepository + * \nosubgrouping + */ class PALUDIS_VISIBLE Layout { private: tr1::shared_ptr<FSEntryCollection> _profiles_dirs; protected: + ///\name Basic operations + ///\{ + Layout(); + ///\} + public: ///\name Basic operations ///\{ @@ -112,7 +123,7 @@ namespace paludis * Thrown if a layout of the specified type does not exist. * * \ingroup grpexceptions - * \ingroup grprepository + * \ingroup grpportagerepository * \nosubgrouping */ class PALUDIS_VISIBLE NoSuchLayoutType : @@ -128,7 +139,7 @@ namespace paludis /** * Virtual constructor for Layout. * - * \ingroup grprepository + * \ingroup grpportagerepository */ class PALUDIS_VISIBLE LayoutMaker : public VirtualConstructor<std::string, diff --git a/paludis/repositories/gentoo/traditional_layout.hh b/paludis/repositories/gentoo/traditional_layout.hh index f2ac04241..7cb4f7bb8 100644 --- a/paludis/repositories/gentoo/traditional_layout.hh +++ b/paludis/repositories/gentoo/traditional_layout.hh @@ -28,6 +28,12 @@ namespace paludis { class PortageRepositoryEntries; + /** + * The traditional tree layout (as used by Gentoo) for a PortageRepository. + * + * \ingroup grpportagerepository + * \nosubgrouping + */ class PALUDIS_VISIBLE TraditionalLayout : public Layout, private PrivateImplementationPattern<TraditionalLayout> @@ -38,11 +44,16 @@ namespace paludis void need_version_specs(const QualifiedPackageName &) const; public: + ///\name Basic operations + ///\{ + TraditionalLayout(const RepositoryName &, const FSEntry &, tr1::shared_ptr<const PortageRepositoryEntries>); virtual ~TraditionalLayout(); + ///\} + virtual bool has_category_named(const CategoryNamePart &) const PALUDIS_ATTRIBUTE((warn_unused_result)); diff --git a/paludis/util/attributes.hh b/paludis/util/attributes.hh index 7d279d662..f5fa2b484 100644 --- a/paludis/util/attributes.hh +++ b/paludis/util/attributes.hh @@ -40,12 +40,6 @@ * \ingroup grplibpaludisutil */ -/** \def PALUDIS_ENABLE_VISIBILITY - * Whether to enable visibility support. - * - * \ingroup grplibpaludisutil - */ - /** \def PALUDIS_VISIBLE * Marker used to represent 'make visible', if visibility is enabled. * diff --git a/paludis/util/fs_entry.hh b/paludis/util/fs_entry.hh index 338d77713..26cb84c81 100644 --- a/paludis/util/fs_entry.hh +++ b/paludis/util/fs_entry.hh @@ -356,20 +356,10 @@ namespace paludis ///\} }; - /** - * An FSEntry can be written to an ostream. - * - * \ingroup grpfilesystem - */ std::ostream & operator<< (std::ostream & s, const FSEntry & f) PALUDIS_VISIBLE; template <typename T_> class SequentialCollection; - /** - * An ordered group of FSEntry instances. - * - * \ingroup grpfilesystem - */ typedef SequentialCollection<FSEntry> FSEntryCollection; } diff --git a/paludis/util/visitor.hh b/paludis/util/visitor.hh index 0c127a921..1baea1913 100644 --- a/paludis/util/visitor.hh +++ b/paludis/util/visitor.hh @@ -36,14 +36,31 @@ namespace paludis { + /** + * \namespace visitor_internals + * \ingroup grpvisitor + * + * For internal use by visitor classes. + */ namespace visitor_internals { + /** + * Derived classes can accept a const visitor of heirarchy H_. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename H_> class PALUDIS_VISIBLE ConstAcceptInterface { protected: + ///\name Visitor operations + ///\{ + virtual void real_const_accept(ConstVisitor<H_> &) const = 0; + ///\} + private: template <bool b_, typename T_> struct ConstAccept @@ -58,31 +75,66 @@ namespace paludis }; public: - typedef H_ Heirarchy; + ///\name Basic operations + ///\{ virtual ~ConstAcceptInterface(); + ///\} + + ///\name Visitor operations + ///\{ + + typedef H_ Heirarchy; + + /** + * Accept a const visitor of either our visitable type, or a + * visitor that can visit a superset of that heirarchy. + */ template <typename V_> void const_accept(V_ & v) const { ConstAccept<tr1::is_same<typename H_::Heirarchy, typename V_::Heirarchy>::value, V_>::forward(this, v); } + /** + * Accept a const visitor of either our visitable type, or a + * visitor that can visit a superset of that heirarchy. + */ template <typename V_> void accept(V_ & v) const { const_accept(v); } + + ///\} }; + /** + * Implementation of ConstAcceptInterface for class T_. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename H_, typename T_> class PALUDIS_VISIBLE ConstAcceptInterfaceVisitsThis : public virtual ConstAcceptInterface<H_> { protected: + ///\name Visitor operations + ///\{ + virtual void real_const_accept(ConstVisitor<H_> & v) const; + + ///\} }; + /** + * Derived classes can accept a const or non-const visitor of heirarchy H_. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename H_> class PALUDIS_VISIBLE MutableAcceptInterface : public ConstAcceptInterface<H_> @@ -113,11 +165,24 @@ namespace paludis }; protected: + ///\name Visitor operations + ///\{ + virtual void real_mutable_accept(MutableVisitor<H_> &) = 0; + ///\} + public: + ///\name Basic operations + ///\{ + virtual ~MutableAcceptInterface(); + ///\} + + ///\name Visitor operations + ///\{ + template <typename V_> void mutable_accept(V_ & v) { @@ -135,18 +200,37 @@ namespace paludis { Accept<V_::visitor_is_const, V_>::forward(this, v); } + + ///\} }; + /** + * Implementation of ConstAcceptInterface for class T_. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename H_, typename T_> class PALUDIS_VISIBLE MutableAcceptInterfaceVisitsThis : public virtual MutableAcceptInterface<H_> { protected: + ///\name Visitor operations + ///\{ + virtual void real_const_accept(ConstVisitor<H_> & v) const; virtual void real_mutable_accept(MutableVisitor<H_> & v); + + ///\} }; + /** + * Used to contain a node with no children in a detached visitable + * heirarchy. + * + * \ingroup grpvisitor + */ template <typename H_, typename T_> class PALUDIS_VISIBLE TreeLeaf : public MutableAcceptInterface<H_> @@ -158,20 +242,41 @@ namespace paludis const tr1::shared_ptr<T_> _item; protected: + ///\name Visitor operations + ///\{ + virtual void real_mutable_accept(MutableVisitor<H_> & v); virtual void real_const_accept(ConstVisitor<H_> & v) const; + ///\} + public: + ///\name Basic operations + ///\{ + virtual ~TreeLeaf(); TreeLeaf(const tr1::shared_ptr<T_> & i); + ///\} + + ///\name Fetch our contained item + ///\{ + tr1::shared_ptr<T_> item(); tr1::shared_ptr<const T_> item() const; + + ///\} }; + /** + * Used to contain a node with a sequence of children in a detached visitable + * heirarchy. + * + * \ingroup grpvisitor + */ template <typename H_, typename T_> class PALUDIS_VISIBLE TreeSequence : public MutableAcceptInterface<H_> @@ -184,19 +289,37 @@ namespace paludis const tr1::shared_ptr<SequentialCollection<tr1::shared_ptr<MutableAcceptInterface<H_> > > > _items; protected: + ///\name Visitor operations + ///\{ + virtual void real_mutable_accept(MutableVisitor<H_> & v); virtual void real_const_accept(ConstVisitor<H_> & v) const; + ///\} + public: + ///\name Basic operations + ///\{ + virtual ~TreeSequence(); TreeSequence(tr1::shared_ptr<T_> i); + ///\} + + ///\name Fetch our contained item + ///\{ + tr1::shared_ptr<const T_> item() const; tr1::shared_ptr<T_> item(); + ///\} + + ///\name Work on our children + ///\{ + void add(tr1::shared_ptr<MutableAcceptInterface<H_> > i); typename H_::ConstSequenceIterator @@ -210,8 +333,16 @@ namespace paludis typename H_::MutableSequenceIterator mutable_end(); + + ///\} }; + /** + * Used to contain a node with a sequence of children in a detached visitable + * heirarchy, where children can only be created in const form. + * + * \ingroup grpvisitor + */ template <typename H_, typename T_> class PALUDIS_VISIBLE ConstTreeSequence : public ConstAcceptInterface<H_> @@ -224,17 +355,35 @@ namespace paludis const tr1::shared_ptr<SequentialCollection<tr1::shared_ptr<const ConstAcceptInterface<H_> > > > _items; protected: + ///\name Visitor operations + ///\{ + virtual void real_const_accept(ConstVisitor<H_> & v) const; + ///\} + public: + ///\name Basic operations + ///\{ + virtual ~ConstTreeSequence(); ConstTreeSequence(tr1::shared_ptr<T_> i); + ///\} + + ///\name Fetch our contained item + ///\{ + tr1::shared_ptr<T_> item(); tr1::shared_ptr<const T_> item() const; + ///\} + + ///\name Work on our children + ///\{ + void add(tr1::shared_ptr<const ConstAcceptInterface<H_> > i); typename H_::ConstSequenceIterator @@ -242,180 +391,430 @@ namespace paludis typename H_::ConstSequenceIterator const_end() const; + + ///\} }; + /** + * Derived classes can visit an item of type T_. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename T_> class PALUDIS_VISIBLE Visits { public: + ///\name Basic operations + ///\{ + virtual ~Visits(); + ///\} + + ///\name Visitor operations + ///\{ + virtual void visit(T_ &) = 0; + + ///\} }; + /** + * Derived classes can visit an item of type T_ (specialisation for + * NoType). + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <unsigned u_> class PALUDIS_VISIBLE Visits<NoType<u_> > { }; + /** + * Derived classes can visit an item of type T_ (specialisation for + * NoType). + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <unsigned u_> class PALUDIS_VISIBLE Visits<const NoType<u_> > { }; + /** + * Derived classes can visit an item of type T_ (specialisation for + * TreeLeaf). + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename H_, typename T_> class PALUDIS_VISIBLE Visits<TreeLeaf<H_, T_> > { public: + ///\name Basic operations + ///\{ + virtual ~Visits(); + ///\} + + ///\name Visitor operations + ///\{ + virtual void visit_leaf(T_ &) = 0; void visit(TreeLeaf<H_, T_> & l); + + ///\} }; + /** + * Derived classes can visit an item of type T_ (specialisation for + * TreeLeaf). + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename H_, typename T_> class PALUDIS_VISIBLE Visits<const TreeLeaf<H_, T_> > { public: + ///\name Basic operations + ///\{ + virtual ~Visits(); + ///\} + + ///\name Visitor operations + ///\{ + virtual void visit_leaf(const T_ &) = 0; void visit(const TreeLeaf<H_, T_> & l); + + ///\} }; + /** + * Derived classes can visit an item of type T_ (specialisation for + * TreeSequence). + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename H_, typename T_> class PALUDIS_VISIBLE Visits<TreeSequence<H_, T_> > { public: + ///\name Basic operations + ///\{ + virtual ~Visits(); + ///\} + + ///\name Visitor operations + ///\{ + virtual void visit_sequence(T_ &, typename TreeSequenceIteratorTypes<H_>::MutableIterator, typename TreeSequenceIteratorTypes<H_>::MutableIterator) = 0; void visit(TreeSequence<H_, T_> & s); + + ///\} }; + /** + * Derived classes can visit an item of type T_ (specialisation for + * TreeSequence). + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename H_, typename T_> class PALUDIS_VISIBLE Visits<const TreeSequence<H_, T_> > { public: + ///\name Basic operations + ///\{ + virtual ~Visits(); + ///\} + + ///\name Visitor operations + ///\{ + virtual void visit_sequence(const T_ &, typename TreeSequenceIteratorTypes<H_>::ConstIterator, typename TreeSequenceIteratorTypes<H_>::ConstIterator) = 0; void visit(const TreeSequence<H_, T_> & s); + + ///\} }; + /** + * Derived classes can visit an item of type T_ (specialisation for + * ConstTreeSequence). + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename H_, typename T_> class PALUDIS_VISIBLE Visits<ConstTreeSequence<H_, T_> > { public: + ///\name Basic operations + ///\{ + virtual ~Visits(); + ///\} + + ///\name Visitor operations + ///\{ + virtual void visit_sequence(const T_ &, typename TreeSequenceIteratorTypes<H_>::ConstIterator, typename TreeSequenceIteratorTypes<H_>::ConstIterator) = 0; void visit(ConstTreeSequence<H_, T_> & s); + + ///\} }; + /** + * Derived classes can visit an item of type T_ (specialisation for + * ConstTreeSequence). + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename H_, typename T_> class PALUDIS_VISIBLE Visits<const ConstTreeSequence<H_, T_> > { public: + ///\name Basic operations + ///\{ + virtual ~Visits(); + ///\} + + ///\name Visitor operations + ///\{ + virtual void visit_sequence(const T_ &, typename TreeSequenceIteratorTypes<H_>::ConstIterator, typename TreeSequenceIteratorTypes<H_>::ConstIterator) = 0; void visit(const ConstTreeSequence<H_, T_> & s); + + ///\} }; + /** + * Container class providing convenience typedefs for iterators over a + * TreeSequence. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename H_> struct TreeSequenceIteratorTypes { + ///\name Visitor operations + ///\{ + typedef libwrapiter::ForwardIterator<TreeSequenceIteratorTypes, const ConstAcceptInterface<H_> > ConstIterator; typedef libwrapiter::ForwardIterator<TreeSequenceIteratorTypes, MutableAcceptInterface<H_> > MutableIterator; + + ///\} }; + /** + * Proxy visitor adapter. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename H_, typename LargerH_, typename T_> class PALUDIS_VISIBLE ProxyVisits : public virtual Visits<T_> { }; + /** + * Proxy visitor adapter. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename H_, typename LargerH_, unsigned u_> class PALUDIS_VISIBLE ProxyVisits<H_, LargerH_, NoType<u_> > { }; + /** + * Proxy visitor adapter. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename H_, typename LargerH_, unsigned u_> class PALUDIS_VISIBLE ProxyVisits<H_, LargerH_, const NoType<u_> > { }; + /** + * Proxy visitor adapter. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename H_, typename LargerH_, typename T_> class PALUDIS_VISIBLE ProxyVisits<H_, LargerH_, const TreeLeaf<H_, T_> > : public virtual Visits<const TreeLeaf<H_, T_> > { public: + ///\name Basic operations + ///\{ + virtual ~ProxyVisits(); + ///\} + + ///\name Visitor operations + ///\{ + virtual void visit_leaf(const T_ & v); + + ///\} }; + /** + * Proxy visitor adapter. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename H_, typename LargerH_, typename T_> class PALUDIS_VISIBLE ProxyVisits<H_, LargerH_, TreeLeaf<H_, T_> > : public virtual Visits<TreeLeaf<H_, T_> > { public: + ///\name Basic operations + ///\{ + virtual ~ProxyVisits(); + ///\} + + ///\name Visitor operations + ///\{ + virtual void visit_leaf(T_ & v); + + ///\} }; + /** + * Proxy visitor adapter. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename H_, typename LargerH_, typename T_> class PALUDIS_VISIBLE ProxyVisits<H_, LargerH_, const ConstTreeSequence<H_, T_> > : public virtual Visits<const ConstTreeSequence<H_, T_> > { public: + ///\name Basic operations + ///\{ + virtual ~ProxyVisits(); + ///\} + + ///\name Visitor operations + ///\{ + virtual void visit_sequence(const T_ & t, typename TreeSequenceIteratorTypes<H_>::ConstIterator c, typename TreeSequenceIteratorTypes<H_>::ConstIterator e); + + ///\} }; + /** + * Proxy visitor adapter. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename H_, typename LargerH_, typename T_> class PALUDIS_VISIBLE ProxyVisits<H_, LargerH_, const TreeSequence<H_, T_> > : public virtual Visits<const TreeSequence<H_, T_> > { public: + ///\name Basic operations + ///\{ + virtual ~ProxyVisits(); + ///\} + + ///\name Visitor operations + ///\{ + virtual void visit_sequence(const T_ & t, typename TreeSequenceIteratorTypes<H_>::ConstIterator c, typename TreeSequenceIteratorTypes<H_>::ConstIterator e); + + ///\} }; + /** + * Proxy visitor adapter. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename H_, typename LargerH_, typename T_> class PALUDIS_VISIBLE ProxyVisits<H_, LargerH_, TreeSequence<H_, T_> > : public virtual Visits<TreeSequence<H_, T_> > { public: + ///\name Basic operations + ///\{ + virtual ~ProxyVisits(); + ///\} + + ///\name Visitor operations + ///\{ + virtual void visit_sequence(T_ & t, typename TreeSequenceIteratorTypes<H_>::MutableIterator c, typename TreeSequenceIteratorTypes<H_>::MutableIterator e); + + ///\} }; + /** + * Proxy visitor. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename H_, typename LargerH_> class PALUDIS_VISIBLE ConstProxyVisitor : public ConstVisitor<H_>, @@ -433,11 +832,27 @@ namespace paludis ConstVisitor<LargerH_> * const _larger_h; public: + ///\name Basic operations + ///\{ + ConstProxyVisitor(ConstVisitor<LargerH_> * const l); + ///\} + + ///\name Visitor operations + ///\{ + ConstVisitor<LargerH_> * larger_visitor() const; + + ///\} }; + /** + * Proxy visitor adapter. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename H_, typename LargerH_> class PALUDIS_VISIBLE MutableProxyVisitor : public MutableVisitor<H_>, @@ -455,11 +870,27 @@ namespace paludis MutableVisitor<LargerH_> * const _larger_h; public: + ///\name Basic operations + ///\{ + MutableProxyVisitor(MutableVisitor<LargerH_> * const l); + ///\} + + ///\name Visitor operations + ///\{ + MutableVisitor<LargerH_> * larger_visitor() const; + + ///\} }; + /** + * Proxy visitor adapter iterator. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename H_, typename LargerH_> class PALUDIS_VISIBLE ConstProxyIterator : public paludis::equality_operators::HasEqualityOperators @@ -479,6 +910,9 @@ namespace paludis mutable tr1::shared_ptr<Adapter> _c; public: + ///\name Basic operations + ///\{ + ConstProxyIterator(typename TreeSequenceIteratorTypes<H_>::ConstIterator i); bool operator== (const ConstProxyIterator & other) const; @@ -488,8 +922,16 @@ namespace paludis const ConstAcceptInterface<LargerH_> & operator* () const; ConstProxyIterator & operator++ (); + + ///\} }; + /** + * Proxy visitor adapter iterator. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename H_, typename LargerH_> class PALUDIS_VISIBLE MutableProxyIterator : public paludis::equality_operators::HasEqualityOperators @@ -511,6 +953,9 @@ namespace paludis mutable tr1::shared_ptr<Adapter> _c; public: + ///\name Basic operations + ///\{ + MutableProxyIterator(typename TreeSequenceIteratorTypes<H_>::MutableIterator i); bool operator== (const MutableProxyIterator & other) const; @@ -520,8 +965,16 @@ namespace paludis MutableAcceptInterface<LargerH_> & operator* () const; MutableProxyIterator & operator++ (); + + ///\} }; + /** + * Define policy for a set of visitor types. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template < typename Heirarchy_, typename BasicNode_, @@ -537,6 +990,9 @@ namespace paludis class VisitorTypes { public: + ///\name Visitor type definitions + ///\{ + typedef Heirarchy_ Heirarchy; typedef BasicNode_ BasicNode; @@ -555,8 +1011,16 @@ namespace paludis typedef typename TreeSequenceIteratorTypes<Heirarchy_>::MutableIterator MutableSequenceIterator; typedef typename TreeSequenceIteratorTypes<Heirarchy_>::ConstIterator ConstSequenceIterator; + + ///\} }; + /** + * A ConstVisitor visits a visitable heirarchy. + * + * \nosubgrouping + * \ingroup grpvisitor + */ template <typename H_> class ConstVisitor : public virtual Visits<const typename H_::ContainedItem1>, @@ -570,29 +1034,64 @@ namespace paludis public virtual Visits<const typename H_::ContainedItem9> { public: + ///\name Visitor type definitions + ///\{ + enum { visitor_is_const = 1 }; typedef typename H_::Heirarchy Heirarchy; + /** + * Derived classes visit a ConstTreeSequence by visiting all of + * its children. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename A_, typename B_> struct PALUDIS_VISIBLE VisitConstSequence : virtual Visits<const ConstTreeSequence<Heirarchy, B_> > { + ///\name Visitor operations + ///\{ + virtual void visit_sequence(const B_ &, typename TreeSequenceIteratorTypes<Heirarchy>::ConstIterator c, typename TreeSequenceIteratorTypes<Heirarchy>::ConstIterator e); + + ///\} }; + /** + * Derived classes visit a TreeSequence by visiting all of + * its children. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename A_, typename B_> struct PALUDIS_VISIBLE VisitSequence : virtual Visits<const TreeSequence<Heirarchy, B_> > { + ///\name Visitor operations + ///\{ + virtual void visit_sequence(const B_ &, typename TreeSequenceIteratorTypes<Heirarchy>::ConstIterator c, typename TreeSequenceIteratorTypes<Heirarchy>::ConstIterator e); + + ///\} }; + + ///\} }; + /** + * A ConstVisitor visits a visitable heirarchy. + * + * \nosubgrouping + * \ingroup grpvisitor + */ template <typename H_> class MutableVisitor : public virtual Visits<typename H_::ContainedItem1>, @@ -606,53 +1105,121 @@ namespace paludis public virtual Visits<typename H_::ContainedItem9> { public: + ///\name Visitor type definitions + ///\{ + enum { visitor_is_const = 0 }; typedef typename H_::Heirarchy Heirarchy; + /** + * Derived classes visit a TreeSequence by visiting all of + * its children. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename A_, typename B_> struct PALUDIS_VISIBLE VisitSequence : virtual Visits<TreeSequence<Heirarchy, B_> > { + ///\name Visitor operations + ///\{ + virtual void visit_sequence(B_ &, typename TreeSequenceIteratorTypes<Heirarchy>::MutableIterator c, typename TreeSequenceIteratorTypes<Heirarchy>::MutableIterator e); + + ///\} }; + + ///\} }; + /** + * For use by get_const_item. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename I_, typename H_, typename T_> struct GetConstItemVisits; + /** + * For use by get_const_item. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename I_, typename H_, unsigned u_> struct PALUDIS_VISIBLE GetConstItemVisits<I_, H_, const visitor_internals::NoType<u_> > { }; + /** + * For use by get_const_item. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename I_, typename T_, typename H_> struct PALUDIS_VISIBLE GetConstItemVisits<I_, H_, const TreeLeaf<H_, T_> > : virtual visitor_internals::Visits<const TreeLeaf<H_, T_> > { + ///\name Visitor operations + ///\{ + void visit_leaf(const T_ & t); + + ///\} }; + /** + * For use by get_const_item. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename I_, typename H_, typename T_> struct PALUDIS_VISIBLE GetConstItemVisits<I_, H_, const ConstTreeSequence<H_, T_> > : virtual visitor_internals::Visits<const ConstTreeSequence<H_, T_> > { + ///\name Visitor operations + ///\{ + void visit_sequence(const T_ & t, typename H_::ConstSequenceIterator, typename H_::ConstSequenceIterator); + + ///\} }; + /** + * For use by get_const_item. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename I_, typename H_, typename T_> struct PALUDIS_VISIBLE GetConstItemVisits<I_, H_, const TreeSequence<H_, T_> > : virtual visitor_internals::Visits<const TreeSequence<H_, T_> > { + ///\name Visitor operations + ///\{ + void visit_sequence(const T_ & t, typename H_::ConstSequenceIterator, typename H_::ConstSequenceIterator); + + ///\} }; + /** + * For use by get_const_item. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename I_> struct PALUDIS_VISIBLE GetConstItemVisitor : ConstVisitor<typename I_::Heirarchy>, @@ -666,16 +1233,33 @@ namespace paludis GetConstItemVisits<GetConstItemVisitor<I_>, typename I_::Heirarchy, const typename I_::Heirarchy::ContainedItem8>, GetConstItemVisits<GetConstItemVisitor<I_>, typename I_::Heirarchy, const typename I_::Heirarchy::ContainedItem9> { + ///\name Visitor operations + ///\{ + const typename I_::Heirarchy::BasicNode * item; GetConstItemVisitor(); + + ///\} }; + /** + * Given a heirarchy node, fetch the associated item. + * + * \ingroup grpvisitor + * \nosubgrouping + */ template <typename I_> const typename I_::Heirarchy::BasicNode * get_const_item(const I_ & i); } + /** + * Used by accept_visitor. + * + * \nosubgrouping + * \ingroup grpvisitor + */ template <typename Visitor_> class PALUDIS_VISIBLE AcceptVisitor { @@ -683,6 +1267,9 @@ namespace paludis Visitor_ & _v; public: + ///\name Visitor operations + ///\{ + AcceptVisitor(Visitor_ & v) : _v(v) { @@ -693,8 +1280,15 @@ namespace paludis { t.accept(_v); } + + ///\} }; + /** + * Convenience function for using a visitor with a standard algorithm. + * + * \ingroup grpvisitor + */ template <typename Visitor_> AcceptVisitor<Visitor_> PALUDIS_VISIBLE accept_visitor(Visitor_ & v) { |