Easy3D 2.6.1
Loading...
Searching...
No Matches
Graph::BaseHandle Class Reference

Base class for all topology types (internally it is basically an index). More...

#include <graph.h>

Inheritance diagram for Graph::BaseHandle:
Graph::Edge Graph::Vertex

Classes

struct  Hash
 Helper structure to be able to use std::unordered_map. More...
 

Public Member Functions

 BaseHandle (int _idx=-1)
 Constructor with index.
 
int idx () const
 Get the underlying index of this handle.
 
void reset ()
 Reset handle to be invalid (index=-1).
 
bool is_valid () const
 Return whether the handle is valid, i.e., the index is not equal to -1.
 
bool operator== (const BaseHandle &_rhs) const
 Equality operator.
 
bool operator!= (const BaseHandle &_rhs) const
 Inequality operator.
 
bool operator< (const BaseHandle &_rhs) const
 Less than operator useful for sorting handles.
 

Friends

class Graph
 

Detailed Description

Base class for all topology types (internally it is basically an index).

See also
Vertex, Edge

Constructor & Destructor Documentation

◆ BaseHandle()

BaseHandle ( int _idx = -1)
inlineexplicit

Constructor with index.

Parameters
_idxThe index of the handle.

Member Function Documentation

◆ idx()

int idx ( ) const
inline

Get the underlying index of this handle.

Returns
The index of the handle.

◆ is_valid()

bool is_valid ( ) const
inline

Return whether the handle is valid, i.e., the index is not equal to -1.

Returns
True if the handle is valid, false otherwise.

◆ operator!=()

bool operator!= ( const BaseHandle & _rhs) const
inline

Inequality operator.

Parameters
_rhsThe other handle to compare with.
Returns
True if the handles are different, false otherwise.

◆ operator<()

bool operator< ( const BaseHandle & _rhs) const
inline

Less than operator useful for sorting handles.

Parameters
_rhsThe other handle to compare with.
Returns
True if this handle is less than the other handle, false otherwise.

◆ operator==()

bool operator== ( const BaseHandle & _rhs) const
inline

Equality operator.

Parameters
_rhsThe other handle to compare with.
Returns
True if the handles are equal, false otherwise.

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