Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
node_map< T, Alloc > Class Template Reference

A specialized map with nodes as keys. More...

#include <JETSCAPE/blob/main/external_packages/gtl/include/GTL/node_map.h>

+ Inheritance diagram for node_map< T, Alloc >:
+ Collaboration diagram for node_map< T, Alloc >:

Public Member Functions

 node_map ()
 
 node_map (const graph &g, T t=T())
 
- Public Member Functions inherited from ne_map< node, T, graph, Alloc >
void init (const graph &, Tdef=T())
 
value_reference operator[] (nodekey)
 
const_value_reference operator[] (nodekey) const
 
void clear ()
 

Additional Inherited Members

- Public Types inherited from ne_map< node, T, graph, Alloc >
typedef vector< T, Alloc >
::reference 
value_reference
 
typedef vector< T, Alloc >
::const_reference 
const_value_reference
 
- Protected Member Functions inherited from ne_map< node, T, graph, Alloc >
 ne_map ()
 
 ne_map (const graph &g, Tdef=T())
 

Detailed Description

template<class T, class Alloc = allocator<T>>
class node_map< T, Alloc >

A specialized map with nodes as keys.

A node_map is a specialized and optimized map implementation with nodes as keys. Using a node_map is the standard way to attach user defined information to the nodes of a graph.

An example of usage:

  graph g;
  node v1 = g.new_node();
  node v2 = g.new_node();
  node_map<string> label(g, "Default Label");
  label[v1] = "v1";
  label[v2] = "v2";
  assert(label[v1] != label[v2]);

The nodes used as keys for a node_map MUST be nodes of the same graph. If you want to use nodes from different graphs, use a map<node,T> instead. A graph and a copy of it are considered to be different.

Most of the functionality of node_map is inherited from ne_map.

See Also
edge_map

Definition at line 54 of file node_map.h.

View newest version in sPHENIX GitHub at line 54 of file node_map.h

Constructor & Destructor Documentation

template<class T, class Alloc = allocator<T>>
node_map< T, Alloc >::node_map ( )
inline

Constructs an empty node_map not associated with any graph. You may (but need not) call ne_map::init(const graph &, T) to associate it to a graph.

Definition at line 64 of file node_map.h.

View newest version in sPHENIX GitHub at line 64 of file node_map.h

template<class T, class Alloc = allocator<T>>
node_map< T, Alloc >::node_map ( const graph g,
T  t = T() 
)
inlineexplicit

Constructs a node_map associated to the graph g. The value associated to each node in g is set to t.

Definition at line 72 of file node_map.h.

View newest version in sPHENIX GitHub at line 72 of file node_map.h


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