aimstil  5.0.5
graph_accessors.h
Go to the documentation of this file.
1 #ifndef TIL_GRAPH_ACCESSORS_H_
2 #define TIL_GRAPH_ACCESSORS_H_
3 
6 
7 namespace til { namespace xsr {
8 
9 
11  namespace graph
12  {
13  template < typename TIterator >
14  struct Position
15  {
16  public: // typedefs
17  typedef typename TIterator::value_type::Vertex value_type;
18  typedef typename TIterator::value_type::Vertex & reference;
19  typedef typename TIterator::value_type::VertexIndex index_type;
20  public: // static accessors
21  // NB: it is not stupid to fix the reference at value_type, because the index_type, hence the iterator,
22  // is also fixed inside the meshvertexnode class.
23  reference
24  operator()(index_type i) const
25  { return i->pos(); }
26  };
27 
28  template < typename TIterator >
29  struct Neighbors
30  {
31  public: // typedefs
32  typedef typename TIterator::value_type::VertexIndexCollection value_type;
33  typedef typename TIterator::value_type::VertexIndexCollection & reference;
34  typedef typename TIterator::value_type::VertexIndex index_type;
35  public: // static accessors
36  reference
37  operator()(index_type i) const
38  { return i->neighbors(); }
39  };
40  }
41 
42 
43 
44 }} // namespace til::xsr
45 
46 
47 #endif /*GRAPH_ACCESSORS_H_*/
Belongs to package Box Do not include directly, include til/Box.h instead.
Definition: Accumulator.h:10
TIterator::value_type::VertexIndex index_type
TIterator::value_type::VertexIndexCollection & reference
TIterator::value_type::VertexIndex index_type
TIterator::value_type::VertexIndexCollection value_type
TIterator::value_type::Vertex value_type
reference operator()(index_type i) const
TIterator::value_type::Vertex & reference
reference operator()(index_type i) const