Ignition Math

API Reference

6.9.3~pre2

A vertex of a graph. It stores user information, an optional name, and keeps an internal unique Id. This class does not enforce to choose a unique name. More...

#include <Vertex.hh>

Public Member Functions

 Vertex (const std::string &_name, const V &_data=V(), const VertexId _id=kNullId)
 Constructor. More...
 
const V & Data () const
 Retrieve the user information. More...
 
V & Data ()
 Get a mutable reference to the user information. More...
 
VertexId Id () const
 Get the vertex Id. More...
 
const std::stringName () const
 Get the vertex name. More...
 
void SetName (const std::string &_name)
 Set the vertex name. More...
 
bool Valid () const
 Whether the vertex is considered valid or not (id==kNullId). More...
 

Static Public Attributes

static Vertex< V > NullVertex
 An invalid vertex. More...
 

Friends

std::ostreamoperator<< (std::ostream &_out, const Vertex< V > &_v)
 Stream insertion operator. The output uses DOT graph description language. More...
 

Detailed Description

template<typename V>
class ignition::math::graph::Vertex< V >

A vertex of a graph. It stores user information, an optional name, and keeps an internal unique Id. This class does not enforce to choose a unique name.

Constructor & Destructor Documentation

◆ Vertex()

Vertex ( const std::string _name,
const V &  _data = V(),
const VertexId  _id = kNullId 
)
inline

Constructor.

Parameters
[in]_nameNon-unique vertex name.
[in]_dataUser information.
[in]_idOptional unique id.

Member Function Documentation

◆ Data() [1/2]

const V& Data ( ) const
inline

Retrieve the user information.

Returns
Reference to the user information.

◆ Data() [2/2]

V& Data ( )
inline

Get a mutable reference to the user information.

Returns
Mutable reference to the user information.

◆ Id()

◆ Name()

const std::string& Name ( ) const
inline

Get the vertex name.

Returns
The vertex name.

◆ SetName()

void SetName ( const std::string _name)
inline

Set the vertex name.

Parameters
[in]_nameThe vertex name.

◆ Valid()

bool Valid ( ) const
inline

Whether the vertex is considered valid or not (id==kNullId).

Returns
True when the vertex is valid or false otherwise (id==kNullId)

References ignition::math::graph::kNullId.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream _out,
const Vertex< V > &  _v 
)
friend

Stream insertion operator. The output uses DOT graph description language.

Parameters
[out]_outThe output stream.
[in]_vVertex to write to the stream.
See also
https://en.wikipedia.org/wiki/DOT_(graph_description_language).

Member Data Documentation

◆ NullVertex

Vertex< V > NullVertex
static

An invalid vertex.


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