10 #ifndef BASE_VERTEX_HPP_INCLUDED
11 #define BASE_VERTEX_HPP_INCLUDED
29 template <
class EdgeAttributesType>
35 typedef typename std::list< EdgeAttributesType >::iterator
iterator;
37 unsigned int nb_of_types_of_degrees;
42 std::vector< std::list< EdgeAttributesType > > neighbours;
43 std::vector< unsigned int > degrees;
52 virtual void clear() = 0;
67 template <
class EdgeAttributesType>
75 template <
class EdgeAttributesType>
78 return degrees[_type];
83 template <
class EdgeAttributesType>
91 template <
class EdgeAttributesType>
94 nb_of_types_of_degrees = _value;
99 template <
class EdgeAttributesType>
105 neighbours[_type].push_back(_info);
110 template <
class EdgeAttributesType>
113 return neighbours[_type].begin();
118 template <
class EdgeAttributesType>
121 return neighbours[_type].end();
126 template <
class EdgeAttributesType>
133 neighbours.resize(nb_of_types_of_degrees);
136 degrees.resize(nb_of_types_of_degrees,0);
141 #endif // BASE_VERTEX_HPP_INCLUDED
void base_vertex_neighbour_insert(unsigned int _type, EdgeAttributesType _info)
Inserts the information of a new neighbour in the neighbours structure.
Definition: base_vertex.hpp:100
std::list< EdgeAttributesType >::iterator iterator
Typedef for iterators used to browse the neighbourhood of the vertex.
Definition: base_vertex.hpp:35
std::string get_name()
Returns the id of the vertex.
Definition: base_vertex.hpp:68
void set_name(std::string _name)
Sets the name of the vertex.
Definition: base_vertex.hpp:84
void set_nb_of_types_of_degrees(unsigned int _value)
Sets the number of types of degrees.
Definition: base_vertex.hpp:92
unsigned int get_base_vertex_degrees(unsigned int _type)
Returns the degree of type _type.
Definition: base_vertex.hpp:76
virtual void clear()=0
Reinitializes the vertex (specific variables).
base_vertex()
Constructor.
Definition: base_vertex.hpp:47
Virtual template base class for vertices in graphs.
Definition: base_vertex.hpp:30
virtual ~base_vertex()
Destructor.
Definition: base_vertex.hpp:48
iterator base_vertex_neighbour_begin(unsigned int _type)
Returns an iterator pointing at the begining of neighbours of type _type.
Definition: base_vertex.hpp:111
void base_vertex_clear()
Reinitializes the variables in the class base_vertex.
Definition: base_vertex.hpp:127
iterator base_vertex_neighbour_end(unsigned int _type)
Returns an iterator pointing at the end of neighbours of type _type.
Definition: base_vertex.hpp:119