graph  5.0.5
Graph: generic attributed relational graphs
Vertex Class Reference

Vertices are created and managed by Graphs. More...

#include <graph/graph/vertex.h>

Inheritance diagram for Vertex:
Collaboration diagram for Vertex:

Public Types

typedef ESet::value_type value_type
 
typedef ESet::pointer pointer
 pointer is absent from MS Visual C++ / Intel Win32 More...
 
typedef ESet::reference reference
 
typedef ESet::const_reference const_reference
 
typedef ESet::iterator iterator
 
typedef ESet::const_iterator const_iterator
 
typedef ESet::reverse_iterator reverse_iterator
 
typedef ESet::const_reverse_iterator const_reverse_iterator
 
- Public Types inherited from carto::SyntaxedObject< T >
typedef internal::SyntaxedObjectSwitch< T, SUPERSUBCLASS(Interface, T)>::ContentType ContentType
 

Public Member Functions

Iterators iterate on the edges
iterator begin ()
 Get the beginning of the edge collection. More...
 
iterator end ()
 Get the end of the edge collection. More...
 
const_iterator begin () const
 Get the beginning of the edge collection. More...
 
const_iterator end () const
 Get the end of the edge collection. More...
 
reverse_iterator rbegin ()
 Get the beginning of the reversed edge collection. More...
 
reverse_iterator rend ()
 Get the end of the reversed edge collection. More...
 
const_reverse_iterator rbegin () const
 Get the beginning of the reversed edge collection. More...
 
const_reverse_iterator rend () const
 Get the end of the reversed edge collection. More...
 
Neighbours
std::set< Vertex * > neighbours () const
 Same as outNeighbours. More...
 
std::set< Vertex * > inNeighbours () const
 Find the vertices for which this vertex is the sink. More...
 
std::set< Vertex * > outNeighbours () const
 Find the vertices for which this vertex is the source. More...
 
VertexrandomNeighbour () const
 Return a random neighbour (CAUTION! not perfectly random) More...
 
- Public Member Functions inherited from GraphObject
virtual ~GraphObject ()
 
- Public Member Functions inherited from carto::SyntaxedObject< T >
 SyntaxedObject (const std::string &s)
 
 SyntaxedObject (const SyntaxedObject &x)
 
 SyntaxedObject (const SyntaxedObject< PropertySet > &x)
 

Friends

Friends
class Graph
 export addEdge and removeEdge More...
 
class GraphFactory
 export the constructors More...
 

Constructors, Destructor

virtual ~Vertex ()
 
 Vertex (std::string s)
 The programmer should not call the constructor. More...
 
 Vertex (const Vertex &x)
 The programmer should not call the copy constructor. More...
 
virtual VertexcloneVertex () const
 The programmer should not clone. More...
 

Edge handling

size_t size () const __attribute__((__deprecated__("use edgesSize() for " "the number of edges. In a future release
 
size_t size () will return the " "number properties as it does in GenericObject")))
 
size_t edgesSize () const
 The edgesSize of a vertex is the number of attached edges. More...
 
bool hasEdge (const Edge *edge) const
 Is a given edge attached to this vertex? More...
 
std::set< Edge * > edgesTo (const Vertex *vertex) const
 Returns the edges linking this vertex to a given vertex. More...
 

Additional Inherited Members

- Protected Member Functions inherited from GraphObject
 GraphObject (const std::string &s)
 The programmer should not call the constructor of an abstract base class. More...
 
 GraphObject (const GraphObject &x)
 

Detailed Description

Vertices are created and managed by Graphs.

See Graph for vertex creation.

Definition at line 63 of file vertex.h.

Member Typedef Documentation

◆ const_iterator

typedef ESet::const_iterator Vertex::const_iterator

Definition at line 79 of file vertex.h.

◆ const_reference

typedef ESet::const_reference Vertex::const_reference

Definition at line 77 of file vertex.h.

◆ const_reverse_iterator

typedef ESet::const_reverse_iterator Vertex::const_reverse_iterator

Definition at line 81 of file vertex.h.

◆ iterator

typedef ESet::iterator Vertex::iterator

Definition at line 78 of file vertex.h.

◆ pointer

typedef ESet::pointer Vertex::pointer

pointer is absent from MS Visual C++ / Intel Win32

Definition at line 74 of file vertex.h.

◆ reference

typedef ESet::reference Vertex::reference

Definition at line 76 of file vertex.h.

◆ reverse_iterator

typedef ESet::reverse_iterator Vertex::reverse_iterator

Definition at line 80 of file vertex.h.

◆ value_type

typedef ESet::value_type Vertex::value_type

Definition at line 71 of file vertex.h.

Constructor & Destructor Documentation

◆ ~Vertex()

virtual Vertex::~Vertex ( )
virtual

◆ Vertex() [1/2]

Vertex::Vertex ( std::string  s)
protected

The programmer should not call the constructor.

Parameters
ssyntactic attribute of the new vertex
See also
Graph for creating vertices

◆ Vertex() [2/2]

Vertex::Vertex ( const Vertex x)
protected

The programmer should not call the copy constructor.

Parameters
xvertex to clone
See also
Graph for creating vertices

Member Function Documentation

◆ begin() [1/2]

Vertex::iterator Vertex::begin ( )
inline

Get the beginning of the edge collection.

Returns
an iterator pointing to the beginning of the edge collection

Definition at line 293 of file vertex.h.

Referenced by Edge::begin().

◆ begin() [2/2]

Vertex::const_iterator Vertex::begin ( ) const
inline

Get the beginning of the edge collection.

Returns
a const_iterator pointing to the beginning of the edge collection

Definition at line 309 of file vertex.h.

◆ cloneVertex()

virtual Vertex* Vertex::cloneVertex ( ) const
protectedvirtual

The programmer should not clone.

Returns
a copy of this vertex
See also
Graph for creating vertices

◆ edgesSize()

size_t Vertex::edgesSize ( ) const

The edgesSize of a vertex is the number of attached edges.

Returns
the number of edges attached to the vertex

◆ edgesTo()

std::set<Edge*> Vertex::edgesTo ( const Vertex vertex) const

Returns the edges linking this vertex to a given vertex.

Parameters
vertexis the sink vertex
Returns
the set of vertices for which this vertex is the source and vertex is the sink

◆ end() [1/2]

Vertex::iterator Vertex::end ( )
inline

Get the end of the edge collection.

Returns
an iterator pointing to the end of the edge collection

Definition at line 301 of file vertex.h.

Referenced by Edge::end().

◆ end() [2/2]

Vertex::const_iterator Vertex::end ( ) const
inline

Get the end of the edge collection.

Returns
a const_iterator pointing to the end of the edge collection

Definition at line 317 of file vertex.h.

◆ hasEdge()

bool Vertex::hasEdge ( const Edge edge) const

Is a given edge attached to this vertex?

Parameters
edgetested edge
Returns
true if the edge is attached to this vertex

◆ inNeighbours()

std::set<Vertex*> Vertex::inNeighbours ( ) const

Find the vertices for which this vertex is the sink.

Returns
the set of vertices for which this vertex is the sink

◆ neighbours()

std::set< Vertex * > Vertex::neighbours ( ) const
inline

Same as outNeighbours.

Still don't know why it works with directed edges!

Definition at line 357 of file vertex.h.

References DECLARE_GENERIC_OBJECT_TYPE.

◆ outNeighbours()

std::set<Vertex*> Vertex::outNeighbours ( ) const

Find the vertices for which this vertex is the source.

Returns
the set of vertices for which this vertex is the source

◆ randomNeighbour()

Vertex* Vertex::randomNeighbour ( ) const

Return a random neighbour (CAUTION! not perfectly random)

Returns
a random neighbour

◆ rbegin() [1/2]

Vertex::reverse_iterator Vertex::rbegin ( )
inline

Get the beginning of the reversed edge collection.

Returns
a reverse_iterator pointing to the beginning of the reversed edge collection

Definition at line 325 of file vertex.h.

◆ rbegin() [2/2]

Vertex::const_reverse_iterator Vertex::rbegin ( ) const
inline

Get the beginning of the reversed edge collection.

Returns
a const_reverse_iterator pointing to the end of the reversed edge collection

Definition at line 341 of file vertex.h.

◆ rend() [1/2]

Vertex::reverse_iterator Vertex::rend ( )
inline

Get the end of the reversed edge collection.

Returns
a reverse_iterator pointing to the end of the reversed edge collection

Definition at line 333 of file vertex.h.

◆ rend() [2/2]

Vertex::const_reverse_iterator Vertex::rend ( ) const
inline

Get the end of the reversed edge collection.

Returns
a const_reverse_iterator pointing to the end of the reversed edge collection

Definition at line 349 of file vertex.h.

◆ size() [1/2]

size_t Vertex::size ( ) const
Deprecated:
{specialization deprecated because ambiguous: use edgeSize() for the number of edges.

In a future release, size() will return the number properties as it does in GenericObject}

◆ size() [2/2]

size_t Vertex::size ( )

Friends And Related Function Documentation

◆ Graph

friend class Graph
friend

export addEdge and removeEdge

Definition at line 244 of file vertex.h.

◆ GraphFactory

friend class GraphFactory
friend

export the constructors

Definition at line 246 of file vertex.h.


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