All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
List of all members | Public Types | Public Member Functions | Related Functions
LoggerBoolMap< IT, KEY > Class Template Reference

Detailed Description

template<typename IT, typename KEY>
class lemon::LoggerBoolMap< IT, KEY >

A writable bool map for logging each true assigned element, i.e it copies subsequently each keys set to true to the given iterator. The most important usage of it is storing certain nodes or arcs that were marked true by an algorithm.

There are several algorithms that provide solutions through bool maps and most of them assign true at most once for each key. In these cases it is a natural request to store each true assigned elements (in order of the assignment), which can be easily done with LoggerBoolMap.

The simplest way of using this map is through the loggerBoolMap() function.

Template Parameters
ITThe type of the iterator.
KEYThe key type of the map. The default value set according to the iterator type should work in most cases.
Note
The container of the iterator must contain enough space for the elements or the iterator should be an inserter iterator.

#include <lemon/maps.h>

+ Inheritance diagram for LoggerBoolMap< IT, KEY >:

Public Types

typedef KEY Key
 
 
typedef bool Value
 
 
typedef IT Iterator
 
 
- Public Types inherited from MapBase< KEY, bool >
typedef KEY Key
 The key type of the map.
 
typedef bool Value
 The value type of the map. (The type of objects associated with the keys).
 

Public Member Functions

 LoggerBoolMap (Iterator it)
 Constructor.
 
Iterator begin () const
 Gives back the given iterator set for the first key.
 
Iterator end () const
 Gives back the the 'after the last' iterator.
 
void set (const Key &key, Value value)
 The set function of the map.
 

Related Functions

(Note that these are not member functions.)

template<typename Iterator >
LoggerBoolMap< IteratorloggerBoolMap (Iterator it)
 Returns a LoggerBoolMap class.