IterableBoolMap< _Graph, _Item > Class Template Reference
[Graph Maps]


Detailed Description

template<typename _Graph, typename _Item>
class lemon::IterableBoolMap< _Graph, _Item >

This class provides a special graph map type which can store for each graph item(node, edge, etc.) a bool value. For both the true and the false it is possible to iterate on the keys which mapped to the given value.

Parameters:
_Graph The graph type.
_Item One of the graph's item type, the key of the map.
#include <lemon/iterable_maps.h>

Inheritance diagram for IterableBoolMap< _Graph, _Item >:

Inheritance graph
[legend]

List of all members.

Classes

class  FalseIt
 Iterator for the keys mapped to false. More...
class  ItemIt
 Iterator for the keys mapped to a given value. More...
class  Reference
 Refernce to the value of the map. More...
class  TrueIt
 Iterator for the keys mapped to true. More...

Public Types

typedef True ReferenceMapTag
 Indicates that the map if reference map.
typedef _Item Key
 The key type.
typedef bool Value
 The value type.
typedef const ValueConstReference
 The const reference type.

Public Member Functions

 IterableBoolMap (const Graph &_graph, bool def=false)
bool operator[] (const Key &key) const
Reference operator[] (const Key &key)
void set (const Key &key, bool value)
void setAll (bool value)
 Set all items.
int trueNum () const
int falseNum () const


Constructor & Destructor Documentation

IterableBoolMap ( const Graph &  _graph,
bool  def = false 
) [inline, explicit]

Constructor of the Map with a default value.


Member Function Documentation

bool operator[] ( const Key key  )  const [inline]

Const subscript operator of the map.

Reimplemented from ArrayMap< _Graph, _Item, _Value >.

Reference operator[] ( const Key key  )  [inline]

Subscript operator of the map.

Reimplemented from ArrayMap< _Graph, _Item, _Value >.

void set ( const Key key,
bool  value 
) [inline]

Set operation of the map.

void setAll ( bool  value  )  [inline]

Set all items in the map.

Note:
Constant time operation.

int trueNum (  )  const [inline]

Returns the number of the keys mapped to true.

int falseNum (  )  const [inline]

Returns the number of the keys mapped to false.


Generated on Thu Jun 4 04:04:53 2009 for LEMON by  doxygen 1.5.9