ROSE 0.11.145.192
Public Member Functions | List of all members
Sawyer::Container::GraphVoidIndex< VertexOrEdgeKey, VertexOrEdgeConstIterator > Class Template Reference

Description

template<class VertexOrEdgeKey, class VertexOrEdgeConstIterator>
class Sawyer::Container::GraphVoidIndex< VertexOrEdgeKey, VertexOrEdgeConstIterator >

Fake index for graphs that don't have an index.

This is the index type used when a vertex or edge index is not required. It has no storage and constant lookup times. The API of the index is documented here. See GraphIndexTraits for information about how to override the index type for a graph.

Definition at line 118 of file Graph.h.

#include <Sawyer/Graph.h>

Public Member Functions

void clear ()
 Erase all data from this index.
 
void insert (const VertexOrEdgeKey &, const VertexOrEdgeConstIterator &)
 Insert a new element into the map.
 
void erase (const VertexOrEdgeKey &)
 Erase an element from the map.
 
Optional< VertexOrEdgeConstIterator > lookup (const VertexOrEdgeKey &) const
 Look up iterator for vertex or edge key.
 

Member Function Documentation

◆ clear()

template<class VertexOrEdgeKey , class VertexOrEdgeConstIterator >
void Sawyer::Container::GraphVoidIndex< VertexOrEdgeKey, VertexOrEdgeConstIterator >::clear ( )
inline

Erase all data from this index.

This resets the index to the same state as if it were default constructed.

Definition at line 123 of file Graph.h.

◆ insert()

template<class VertexOrEdgeKey , class VertexOrEdgeConstIterator >
void Sawyer::Container::GraphVoidIndex< VertexOrEdgeKey, VertexOrEdgeConstIterator >::insert ( const VertexOrEdgeKey &  ,
const VertexOrEdgeConstIterator &   
)
inline

Insert a new element into the map.

Inserts a mapping from a vertex or edge key to a vertex or edge const iterator regardless of whether the key already exists in the map. The index should never contain duplicate keys, so if the same key is inserted twice the second one overrides the first one. In other words, inserting a key/iterator pair into an index behaves exactly the same whether the index is implemented as an std::map from key to value or an array indexed by a key.

Definition at line 131 of file Graph.h.

◆ erase()

template<class VertexOrEdgeKey , class VertexOrEdgeConstIterator >
void Sawyer::Container::GraphVoidIndex< VertexOrEdgeKey, VertexOrEdgeConstIterator >::erase ( const VertexOrEdgeKey &  )
inline

Erase an element from the map.

Erases the mapping for the specified key. If the key does not exist in the index then nothing happens.

Definition at line 136 of file Graph.h.

◆ lookup()

template<class VertexOrEdgeKey , class VertexOrEdgeConstIterator >
Optional< VertexOrEdgeConstIterator > Sawyer::Container::GraphVoidIndex< VertexOrEdgeKey, VertexOrEdgeConstIterator >::lookup ( const VertexOrEdgeKey &  ) const
inline

Look up iterator for vertex or edge key.

Given a vertex or edge key, return the graph vertex or edge const iterator for that key. If the key does not exist in the index then return nothing.

Definition at line 142 of file Graph.h.


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