XNetwork 1.7.5; VERSION ${PROJECT_VERSION}
Loading...
Searching...
No Matches
Public Member Functions | List of all members
xnetwork::NodeView< nodeview_t > Class Template Reference

NodeView class - acts as gra.nodes() for an XNetwork Graph. More...

#include <reportviews.hpp>

Public Member Functions

 NodeView (nodeview_t &nodes)
 Construct a NodeView from a node container.
 
auto size () const
 Get the number of nodes in the view.
 
auto begin () const
 Get iterator to the beginning of the view.
 
auto end () const
 Get iterator to the end of the view.
 
auto operator[] (const Node &node) const -> const auto &
 Access node data at specified node (const version)
 
auto operator[] (const Node &node) -> auto &
 Access node data at specified node (non-const version)
 
auto contains (const Node &node) const -> bool
 Check if a node exists in the view.
 

Detailed Description

template<typename nodeview_t>
class xnetwork::NodeView< nodeview_t >

NodeView class - acts as gra.nodes() for an XNetwork Graph.

Set operations act on the nodes without considering data. Iteration is over nodes. Node data can be looked up like a dict.

Template Parameters
nodeview_tThe underlying node container type

Constructor & Destructor Documentation

◆ NodeView()

template<typename nodeview_t >
xnetwork::NodeView< nodeview_t >::NodeView ( nodeview_t &  nodes)
inlineexplicit

Construct a NodeView from a node container.

Parameters
nodesThe node container to create a view of

Member Function Documentation

◆ begin()

template<typename nodeview_t >
auto xnetwork::NodeView< nodeview_t >::begin ( ) const
inline

Get iterator to the beginning of the view.

Returns
Iterator to the first node

◆ contains()

template<typename nodeview_t >
auto xnetwork::NodeView< nodeview_t >::contains ( const Node &  node) const -> bool
inline

Check if a node exists in the view.

Parameters
nodeThe node to check for
Returns
true if the node exists, false otherwise

◆ end()

template<typename nodeview_t >
auto xnetwork::NodeView< nodeview_t >::end ( ) const
inline

Get iterator to the end of the view.

Returns
Iterator past the last node

◆ operator[]() [1/2]

template<typename nodeview_t >
auto xnetwork::NodeView< nodeview_t >::operator[] ( const Node &  node) -> auto&
inline

Access node data at specified node (non-const version)

Parameters
nodeThe node to access
Returns
Reference to the node data

◆ operator[]() [2/2]

template<typename nodeview_t >
auto xnetwork::NodeView< nodeview_t >::operator[] ( const Node &  node) const -> const auto&
inline

Access node data at specified node (const version)

Parameters
nodeThe node to access
Returns
Const reference to the node data

◆ size()

template<typename nodeview_t >
auto xnetwork::NodeView< nodeview_t >::size ( ) const
inline

Get the number of nodes in the view.

Returns
The size of the node container

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