Siena Fast Forwarding Documentation (v. 2.0.1)
Classes | Public Member Functions | List of all members
siena::TagSetList Class Referenceabstract

interface of a generic predicate in the "tagset" Siena data model. More...

#include <tags.h>

Classes

class  Iterator
 interface of a generic reference to a tagset in a tagset list. More...
 

Public Member Functions

virtual ~TagSetList ()
 virtual destructor
 
virtual Iteratorfirst () const =0
 returns an iterator over this predicate. More...
 

Detailed Description

interface of a generic predicate in the "tagset" Siena data model.

A predicate is essentially a collection of tag sets, thus the name TagSetList. Each tag set F in a predicate represents a logical filter that matches a message described by another tagset M when M is a superset of F. Thus a message defined by a tag set M matches a predicate P if and only if P contains at least one tag set F such that M is a superset of F. The tag sets in a predicate can be accessed sequentially through a TagSetList::Iterator.

The following code exemplifies the structure and access mode for a TagSetList:

#include <siena/tags.h>
class SimpleTagSetList : public siena::TagSetList {
//...
};
SimpleTagSetList tsl;
// ... here we
//
// we now print the content of tsl
//
siena::TagSetList::Iterator * ts = tsl.first();
if (ts == 0) {
cout << "no tag sets" endl;
} else {
cout << "Tag set:";
if (i != 0) {
do {
std::cout << " " << i->to_string();
} while(i->next());
delete(i);
cout << std::endl;
}
delete(ts);
}

Notice that iterators must be explicitly deallocated.

Examples:
simple_tags_types.h.

Member Function Documentation

virtual Iterator* siena::TagSetList::first ( ) const
pure virtual

returns an iterator over this predicate.

Returns
iterator pointing to the first tag set in this predicate, or 0 (NULL) if this predicate is empty.
Examples:
simple_tags_types.h.