tag_collection Class Template Reference

A tag collection is a set of tags of the same type. It is used to prescribe steps. By default, it is not stored. More...

List of all members.

Public Member Functions

template<class Derived>
 tag_collection (context< Derived > *ctxt, bool preserveTags=false)
 constructor which registers collection with given context
void put (const Tag &t)
 prescribe the associated step. If we are preserving tags for this collection, make a copy of the tag and store it in the collection.
const_iterator begin () const
 returns begin() as in STL containers
const_iterator end () const
 returns end() as in STL containers
void reset ()
 removes all of the tag instances from the collection
size_t size ()
 returns number of elements in collection
bool empty ()
 returns true if size()==0, false otherwise


Detailed Description

template<typename Tag, typename hash_compare = cnc_tag_hash_compare< Tag >>
class CnC::tag_collection< Tag, hash_compare >

A tag collection is a set of tags of the same type. It is used to prescribe steps. By default, it is not stored.

Tag must provide copy and default constructors and the assigment operator.

If Tag is not convertable into size_t, a suitable hash_compare class must be provided which satisifies the requirements for tbb::concurrent_hash_map. The default cnc_tag_hash_compare works for types that can be converted to size_t and have an operator==. You can provide a specialized template for cnc_tag_hash_compare or specify and implement your own compatible class.

Definition at line 125 of file cnc.h.


Constructor & Destructor Documentation

tag_collection ( context< Derived > *  ctxt,
bool  preserveTags = false 
) [inline]

constructor which registers collection with given context

Parameters:
ctxt the context this collection belongs to
preserveTags when requested, the tag collection can preserve tags, by default tags are not stored


Member Function Documentation

void put ( const Tag &  t  ) 

prescribe the associated step. If we are preserving tags for this collection, make a copy of the tag and store it in the collection.

Parameters:
t the tag to be put

const_iterator begin (  )  const

returns begin() as in STL containers

Note:
iteration through collections is not thread safe, use it only between calls to CnC::context:.wait() and putting tags

const_iterator end (  )  const

returns end() as in STL containers

Note:
iteration through collections is not thread safe, use it only between calls to CnC::context:.wait() and putting tags


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

Generated on Wed Sep 9 20:07:04 2009 for CnC by  doxygen 1.5.6