DiaDes  0.1
DIAgnosis of Discrete-Event System
Public Types | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Diades::Graph::Edge Class Reference

#include <Edge.hh>

Public Types

typedef Diades::Utils::Exception< EdgeException
 
typedef EdgeData::EdgeId EdgeId
 

Public Member Functions

Constructors
 Edge ()=default
 
 Edge (const Edge &edge)=default
 
 Edge (EdgeData *data)
 
 ~Edge ()=default
 
EdgeDatadata ()
 
Edgeoperator= (const Edge &edge)=default
 
Edgeoperator= (Edge &&other)=default
 
Accessors
Node source () const
 
Node target () const
 
const NodesourceRef () const
 
const NodetargetRef () const
 
bool valid () const
 
bool operator== (const Edge &edge) const
 
bool operator!= (const Edge &edge) const
 
bool operator< (const Edge &edge) const
 
bool operator> (const Edge &edge) const
 
EdgeId id () const
 
const Graphowner () const
 
int memoryUsage () const
 

Static Public Member Functions

static string typeName ()
 

Private Member Functions

list< Edge >::iterator sourcePos () const
 data associated with the current Edge More...
 
list< Edge >::iterator targetPos () const
 
void create (EdgeId idt, NodeData *s, NodeData *t)
 
void destroy ()
 
void changeSource (NodeData *s)
 
void changeTarget (NodeData *t)
 

Private Attributes

EdgeData_eData
 

Friends

class Graph
 Edge is a friend class of Graph. More...
 
class Node
 Edge is a friend of Node. More...
 
Stream operation
ostream & operator<< (ostream &os, const Edge &edge)
 

Detailed Description

An Edge of the Graph

An Edge of a Graph defines an edge between a source Node and a target Node To associate an information with one Edge, you can use a EdgeMap<T>

Author
Y. Pencolé
Version
1.0

Definition at line 35 of file Edge.hh.

Member Typedef Documentation

◆ EdgeId

typedef EdgeData::EdgeId Diades::Graph::Edge::EdgeId

Definition at line 45 of file Edge.hh.

◆ Exception

typedef Diades::Utils::Exception<Edge> Diades::Graph::Edge::Exception

Definition at line 43 of file Edge.hh.

Constructor & Destructor Documentation

◆ Edge() [1/3]

Diades::Graph::Edge::Edge ( )
default

Default constructor

Create an invalid transition.

Referenced by memoryUsage(), Diades::Graph::NodeData::newInEdge(), and Diades::Graph::NodeData::newOutEdge().

◆ Edge() [2/3]

Diades::Graph::Edge::Edge ( const Edge edge)
default

Copy constructor.

Parameters
tEdge to copy

◆ Edge() [3/3]

Diades::Graph::Edge::Edge ( EdgeData data)
inline

Constructor that maps with a given EdgeData

Parameters
data

Definition at line 68 of file Edge.hh.

References require, and ~Edge().

◆ ~Edge()

Diades::Graph::Edge::~Edge ( )
default

Destructor

Referenced by Edge().

Member Function Documentation

◆ changeSource()

void Diades::Graph::Edge::changeSource ( NodeData s)
inlineprivate
Parameters
sthe new source of the edge (as a NodeData)

Definition at line 129 of file EdgeImpl.hh.

References ensure, Diades::Graph::NodeData::newOutEdge(), Diades::Graph::NodeData::owner(), require, and Diades::Graph::Graph::valid().

Referenced by destroy().

◆ changeTarget()

void Diades::Graph::Edge::changeTarget ( NodeData t)
inlineprivate
Parameters
sthe new target of the edge (as a NodeData)

Definition at line 143 of file EdgeImpl.hh.

References ensure, Diades::Graph::NodeData::newInEdge(), Diades::Graph::NodeData::owner(), require, and Diades::Graph::Graph::valid().

Referenced by destroy().

◆ create()

void Diades::Graph::Edge::create ( EdgeId  idt,
NodeData s,
NodeData t 
)
inlineprivate
Parameters
idtthe identifier of the edge
sthe source of the edge (as a NodeData)
tthe target of the edge (as a NodeData)

create an EdgeData for an edge from Node(s) to Node(t)

Definition at line 115 of file EdgeImpl.hh.

References Diades::Graph::EdgeData::EdgeData(), ensure, Diades::Graph::NodeData::newInEdge(), Diades::Graph::NodeData::newOutEdge(), Diades::Graph::NodeData::owner(), require, and Diades::Graph::Graph::valid().

Referenced by targetPos().

◆ data()

EdgeData* Diades::Graph::Edge::data ( )
inline
Returns
the data of the Edge

Definition at line 87 of file Edge.hh.

References _eData, operator=(), source(), sourceRef(), target(), targetRef(), and valid().

◆ destroy()

void Diades::Graph::Edge::destroy ( )
inlineprivate

◆ id()

EdgeId Diades::Graph::Edge::id ( ) const
inline

◆ memoryUsage()

int Diades::Graph::Edge::memoryUsage ( ) const
inline

Size of an Edge object

Returns
the memory usage of an Edge object (not including EdgeData)

Definition at line 194 of file Edge.hh.

References Edge().

◆ operator!=()

bool Diades::Graph::Edge::operator!= ( const Edge edge) const
inline

Inequality operator

Parameters
tEdge to compare
Returns
true if the transitions are not the same in the Graph

Definition at line 159 of file Edge.hh.

References operator<().

◆ operator<()

bool Diades::Graph::Edge::operator< ( const Edge edge) const
inline

Order of Edge

Definition at line 93 of file EdgeImpl.hh.

References id(), Diades::Graph::Graph::id(), owner(), valid(), and Diades::Graph::Graph::valid().

Referenced by operator!=().

◆ operator=() [1/2]

Edge& Diades::Graph::Edge::operator= ( const Edge edge)
default

Assignation

Referenced by data().

◆ operator=() [2/2]

Edge& Diades::Graph::Edge::operator= ( Edge &&  other)
default

Move assignement (default)

Parameters
other
Returns
the current ComposableModel

◆ operator==()

bool Diades::Graph::Edge::operator== ( const Edge edge) const
inline

Equality operator

Parameters
tEdge to compare
Returns
true if the transitions are the same in the Graph

Definition at line 150 of file Edge.hh.

References _eData.

◆ operator>()

bool Diades::Graph::Edge::operator> ( const Edge edge) const
inline

Definition at line 169 of file Edge.hh.

◆ owner()

const Graph & Diades::Graph::Edge::owner ( ) const
inline

◆ source()

Node Diades::Graph::Edge::source ( ) const
inline

source state

Precondition
valid()
Returns
the source state of the transition.

Definition at line 39 of file EdgeImpl.hh.

Referenced by data().

◆ sourcePos()

list<Edge>::iterator Diades::Graph::Edge::sourcePos ( ) const
inlineprivate

data associated with the current Edge

Returns
the position of this edge in the list of the source node

Definition at line 210 of file Edge.hh.

References Diades::Graph::EdgeData::_sourcePos, and require.

◆ sourceRef()

const Node & Diades::Graph::Edge::sourceRef ( ) const
inline

source state

Precondition
valid(). As long as the returned reference is in use, the Graph must not be modified.
Returns
the source state of the transition.

Definition at line 56 of file EdgeImpl.hh.

Referenced by data().

◆ target()

Node Diades::Graph::Edge::target ( ) const
inline

target state

Precondition
valid()
Returns
the target state of the transition.

Definition at line 47 of file EdgeImpl.hh.

Referenced by data().

◆ targetPos()

list<Edge>::iterator Diades::Graph::Edge::targetPos ( ) const
inlineprivate
Returns
the position of this edge in the list of the target node

Definition at line 220 of file Edge.hh.

References Diades::Graph::EdgeData::_targetPos, create(), and require.

◆ targetRef()

const Node & Diades::Graph::Edge::targetRef ( ) const
inline

target state

Precondition
valid().As long as the returned reference is in use, the Graph must not be modified.
Returns
the target state of the transition.

Definition at line 65 of file EdgeImpl.hh.

Referenced by data().

◆ typeName()

static string Diades::Graph::Edge::typeName ( )
inlinestatic

Definition at line 39 of file Edge.hh.

◆ valid()

bool Diades::Graph::Edge::valid ( ) const
inline

Friends And Related Function Documentation

◆ Graph

friend class Graph
friend

Edge is a friend class of Graph.

Definition at line 265 of file Edge.hh.

◆ Node

friend class Node
friend

Edge is a friend of Node.

Definition at line 267 of file Edge.hh.

◆ operator<<

ostream& operator<< ( ostream &  os,
const Edge edge 
)
friend

Output stream operator

Postcondition
the output stream os contains the identifier edge.id() of the Edge edge

Definition at line 275 of file Edge.hh.

Member Data Documentation

◆ _eData

EdgeData* Diades::Graph::Edge::_eData
private

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