Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

TagSet.h

Go to the documentation of this file.
00001 #ifndef TAGCOLL_TAG_SET_H
00002 #define TAGCOLL_TAG_SET_H
00003 
00004 /*
00005  * Set of tags and set of facets
00006  *
00007  * Copyright (C) 2003  Enrico Zini <enrico@debian.org>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022  */
00023 
00024 #pragma interface
00025 
00026 #include <tagcoll/Tag.h>
00027 
00028 #include <tagcoll/OpSet.h>
00029 
00030 namespace Tagcoll
00031 {
00032 
00033 class FacetSet;
00034 class TagMatcher;
00035 class TagConsumer;
00036 class FacetMatcher;
00037 class FacetConsumer;
00038 
00039 class TagSet : public OpSet<Tag>
00040 {
00041 public:
00042     using OpSet<Tag>::find;
00043 
00044     TagSet() throw ();
00045     TagSet(const OpSet<Tag>&) throw ();
00046     ~TagSet() throw ();
00047 
00048     FacetSet getFacets() const throw ();
00049 
00050     // Returns true if the set contains the tag named `tag'
00051     bool has(const std::string& tag) const throw ();
00052 
00053     // Get the Tag object given the package name
00054     Tag find(const std::string& name) const throw ();
00055 
00056     TagSet getFiltered(const TagMatcher& filter) const throw ();
00057     void output(TagConsumer& cons) const throw ();
00058     void output(TagConsumer& cons, TagMatcher& filter) const throw ();
00059 };
00060 
00061 class FacetSet : public OpSet<Facet>
00062 {
00063 public:
00064     using OpSet<Facet>::find;
00065 
00066     FacetSet() throw ();
00067     FacetSet(const OpSet<Facet>&) throw ();
00068     ~FacetSet() throw ();
00069 
00072     Facet obtainFacet(const std::string& name) throw ();
00073 
00076     Tag obtainTag(const std::string& fullname) throw ();
00077 
00078     // Get all the tags contained in these facets
00079     TagSet getTags() const throw ();
00080 
00081     // Returns true if the set contains the facet named `facet'
00082     bool has(const std::string& facet) const throw ();
00083 
00084     // Returns true if one of the facets in the set contains the tag named
00085     // `tag'
00086     bool hasTag(const std::string& tag) const throw ();
00087 
00088     // Get the Facet object given the package name
00089     Facet find(const std::string& name) const throw ();
00090 
00091     // Get the tag with the given name, if contained in one of these facets
00092     Tag findTag(const std::string& tag) const throw ();
00093     
00094     FacetSet getFiltered(const FacetMatcher& filter) const throw ();
00095     void output(FacetConsumer& cons) const throw ();
00096     void output(FacetConsumer& cons, FacetMatcher& filter) const throw ();
00097 
00098     // Output all the tags contained in these facetes to cons
00099     TagSet getFiltered(const TagMatcher& filter) const throw ();
00100     void output(TagConsumer& cons) const throw ();
00101     void output(TagConsumer& cons, TagMatcher& filter) const throw ();
00102 };
00103 
00104 };
00105 
00106 // vim:set ts=4 sw=4:
00107 #endif

Generated on Thu Jun 23 11:53:20 2005 for libtagcoll by  doxygen 1.4.3-20050530