GEGELATI

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
TPG::TPGVertex Class Reference

Abstract class representing the vertices of a TPGGraph. More...

`#include <tpgVertex.h>`

Inheritance diagram for TPG::TPGVertex:

## Public Member Functions
virtual | ~TPGVertex ()=default
| Default polymorphic destructor.
const std::list< TPGEdge * > & | getIncomingEdges () const
| Get a const reference to incoming edges of this TPGVertex.
const std::list< TPGEdge * > & | getOutgoingEdges () const
| Get a const reference to outgoing edges of this TPGVertex.
virtual void | addIncomingEdge (TPG::TPGEdge *edge)
| Method to add an incoming TPGEdge to the TPGVertex.
virtual void | removeIncomingEdge (TPG::TPGEdge *edge)
| Removes the given incoming edge from the TPGVertex.
virtual void | addOutgoingEdge (TPG::TPGEdge *edge)
| Method to add an outgoing TPGEdge to the TPGVertex.
virtual void | removeOutgoingEdge (TPG::TPGEdge *edge)
| Removes the given outgoing edge from the TPGVertex.
virtual const std::set< uint64_t > & | getAssessedActions () const
| return assessed actions
virtual void | updateAssessedActions ()
| Update the assessed actions.
virtual bool | hasSameAssessedActions (std::set< uint64_t > actions) const
| compare the set given and the assessed actions of the vertex
virtual uint64_t | getVertexID () const
| Get the unique identifier of the TPGVertex.
virtual void | setVertexID (uint64_t newID)
| Set a new unique identifier to the TPGVertex.

## Static Public Member Functions
static uint64_t | getVertexIDCounter ()
| Get the current value of the vertex ID counter.

## Protected Member Functions
| TPGVertex ()
| Protected default constructor to forbid the instanciation of object of this abstract class.

## Static Protected Member Functions
static uint64_t | incrementeCounter ()
| Incremente the vertex ID counter and return the new value.
static void | resetVertexIDCounter ()
| Reset the vertex ID counter.

## Protected Attributes
std::list< TPG::TPGEdge * > | incomingEdges
| Set of incoming TPGEdge of the TPGVertex.
std::list< TPG::TPGEdge * > | outgoingEdges
| Set of outgoing TPGEdge of the TPGVertex.
std::set< uint64_t > | assessedActions
| Set of assessed actions by the team.
uint64_t | vertexID
| Unique identifier of the TPGVertex.

## Friends
struct | ::CounterReset

## Detailed Description

Abstract class representing the vertices of a TPGGraph.

## Member Function Documentation

## ◆ addIncomingEdge()

void TPG::TPGVertex::addIncomingEdge | ( | TPG::TPGEdge * | edge | ) |
| virtual

Method to add an incoming TPGEdge to the TPGVertex.

Since the incomingEdges set is a std::set, the same TPGEdge pointer can not be added twice to the set. This method does not register the TPGVertex as the destination of the TPGEdge.

Parameters

  [in] | edge | the TPGEdge pointer to be added to the incomingEdges Set.

## ◆ addOutgoingEdge()

void TPG::TPGVertex::addOutgoingEdge | ( | TPG::TPGEdge * | edge | ) |
| virtual

Method to add an outgoing TPGEdge to the TPGVertex.

Since the outgoingEdges set is a std::set, the same TPGEdge pointer can not be added twice to the set. This method does not register the TPGVertex as the spource of the TPGEdge.

Parameters

  [in] | edge | the TPGEdge pointer to be added to the outgoingEdges Set.

Reimplemented in TPG::TPGAction, and TPG::TPGTeam.

## ◆ getVertexID()

uint64_t TPG::TPGVertex::getVertexID | ( |  | ) | const
| virtual

Get the unique identifier of the TPGVertex.

Returns
  the integer ID of the TPGVertex.

## ◆ getVertexIDCounter()

uint64_t TPG::TPGVertex::getVertexIDCounter | ( |  | ) |
| static

Get the current value of the vertex ID counter.

This method is mainly used for testing purpose to ensure that vertex IDs are predictable.

Returns
  the current value of the vertex ID counter.

## ◆ hasSameAssessedActions()

bool TPG::TPGVertex::hasSameAssessedActions | ( | std::set< uint64_t > | actions | ) | const
| virtual

compare the set given and the assessed actions of the vertex

If the intersection is empty, return false, else true

## ◆ removeIncomingEdge()

void TPG::TPGVertex::removeIncomingEdge | ( | TPG::TPGEdge * | edge | ) |
| virtual

Removes the given incoming edge from the TPGVertex.

If the given pointer is NULL or if the given edge is not in the set of the TPGVertex, nothing happens. Otherwise, the edge is removed.

Parameters

  [in] | edge | the TPGEdge to remove.

## ◆ removeOutgoingEdge()

void TPG::TPGVertex::removeOutgoingEdge | ( | TPG::TPGEdge * | edge | ) |
| virtual

Removes the given outgoing edge from the TPGVertex.

If the given pointer is NULL or if the given edge is not in the set of the TPGVertex, nothing happens. Otherwise, the edge is removed.

Parameters

  [in] | edge | the TPGEdge to remove.

## ◆ resetVertexIDCounter()

void TPG::TPGVertex::resetVertexIDCounter | ( |  | ) |
| staticprotected

Reset the vertex ID counter.

This method set the ID counter to a new value. It can quickly lead to segmentation fault if not used carefully.

## ◆ setVertexID()

void TPG::TPGVertex::setVertexID | ( | uint64_t | newID | ) |
| virtual

Set a new unique identifier to the TPGVertex.

Parameters

  [in] | newID | the new integer ID to set to the TPGVertex.

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

- D:/a/gegelati/gegelati/gegelatilib/include/tpg/tpgVertex.h
- D:/a/gegelati/gegelati/gegelatilib/src/tpg/tpgVertex.cpp