mp_stories
Sneaky Stories
Edge Class Reference
Inheritance diagram for Edge:
[legend]
Collaboration diagram for Edge:
[legend]

Public Member Functions

 Edge (const Vertex &source, const Vertex &dest, double weight=1)
 
const Vertexsource () const
 Returns the source Vertex of the Edge. More...
 
const Vertexdest () const
 Returns the destination Vertex of the Edge. More...
 
double weight () const
 Returns the weight of the Edge. More...
 
virtual bool directed () const
 Returns true if the Edge is directed; otherwise false. More...
 
bool operator== (const Edge &other) const
 Returns true if the Edge connects the same vertex endpoints as the other Edge. More...
 
string & operator[] (const string &value)
 Add, modify, or read a key/value propoerty of the Edge. More...
 

Private Attributes

const Vertexsource_
 
const Vertexdest_
 
double weight_
 
std::unordered_map< string, string > properties_
 

Friends

std::ostreamoperator<< (std::ostream &out, const Edge &edge)
 Prints out the Edge in a human-readable format to out More...
 

Member Function Documentation

◆ dest()

const Vertex& Edge::dest ( ) const
inline

Returns the destination Vertex of the Edge.

◆ directed()

virtual bool Edge::directed ( ) const
inlinevirtual

Returns true if the Edge is directed; otherwise false.

Reimplemented in DirectedEdge.

◆ operator==()

bool Edge::operator== ( const Edge other) const
inline

Returns true if the Edge connects the same vertex endpoints as the other Edge.

In an undirected graph, this function returns true when the endpoints are swapped.

◆ operator[]()

string& Edge::operator[] ( const string &  value)
inline

Add, modify, or read a key/value propoerty of the Edge.

◆ source()

const Vertex& Edge::source ( ) const
inline

Returns the source Vertex of the Edge.

◆ weight()

double Edge::weight ( ) const
inline

Returns the weight of the Edge.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream out,
const Edge edge 
)
friend

Prints out the Edge in a human-readable format to out


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