#include <PatchCollection.h>
Inheritance diagram for Tagcoll::PatchCollection< ITEM, TAG >:
Public Member Functions | |
PatchCollection (const ReadonlyCollection< ITEM, TAG > &coll) | |
virtual | ~PatchCollection () |
const PatchList< ITEM, TAG > & | getChanges () const |
Get the changes that have been applied to this collection. | |
void | resetChanges () |
Throw away all changes previously applied to this collection. | |
void | setChanges (const PatchList< ITEM, TAG > &changes) |
Set the changes list to a specific patch list. | |
void | addChanges (const PatchList< ITEM, TAG > &changes) |
Add a specific patch list to the changes list. | |
virtual bool | hasTag (const TAG &tag) const |
Check if the collection contains a tag. | |
virtual OpSet< ITEM > | getTaggedItems () const |
Get the set of all the items that have tags according to this collection. | |
virtual OpSet< TAG > | getAllTags () const |
Get the set of all the tags in this collection. | |
virtual int | getCardinality (const TAG &tag) const |
Get the cardinality of tag `tag' (that is, the number of items who have it). | |
virtual void | applyChange (const PatchList< ITEM, TAG > &change) |
Apply a patch to the collection. | |
virtual void | output (Consumer< ITEM, TAG > &consumer) const |
Output all the contents of the collection to a Consumer. | |
Protected Member Functions | |
virtual void | consumeItem (const ITEM &item, const OpSet< TAG > &tags) |
Process a tagged item, with its tags. | |
virtual OpSet< ITEM > | getItemsHavingTag (const TAG &tag) const |
Get the items which are tagged with at least the tag `tag'. | |
virtual OpSet< TAG > | getTagsOfItem (const ITEM &item) const |
Get the tags attached to an item. | |
Protected Attributes | |
const ReadonlyCollection< ITEM, TAG > & | coll |
PatchList< ITEM, TAG > | changes |
|
|
|
|
|
Add a specific patch list to the changes list.
|
|
Apply a patch to the collection. Example: void perform(const PatchList<ITEM, TAG>& change) { collection.applyChange(change); undo.push_back(change.getReverse()); } Implements Tagcoll::Collection< ITEM, TAG >. |
|
Process a tagged item, with its tags.
Implements Tagcoll::Consumer< ITEM, TAG >. |
|
Get the set of all the tags in this collection.
Implements Tagcoll::ReadonlyCollection< ITEM, TAG >. |
|
Get the cardinality of tag `tag' (that is, the number of items who have it).
Reimplemented from Tagcoll::ReadonlyCollection< ITEM, TAG >. |
|
Get the changes that have been applied to this collection.
|
|
Get the items which are tagged with at least the tag `tag'.
Implements Tagcoll::ReadonlyCollection< ITEM, TAG >. |
|
Get the set of all the items that have tags according to this collection.
Implements Tagcoll::ReadonlyCollection< ITEM, TAG >. |
|
Get the tags attached to an item.
Implements Tagcoll::ReadonlyCollection< ITEM, TAG >. |
|
Check if the collection contains a tag.
Reimplemented from Tagcoll::ReadonlyCollection< ITEM, TAG >. |
|
Output all the contents of the collection to a Consumer.
Implements Tagcoll::ReadonlyCollection< ITEM, TAG >. |
|
Throw away all changes previously applied to this collection.
|
|
Set the changes list to a specific patch list.
|
|
|
|
|