timemory 3.3.0
Modular C++ Toolkit for Performance Analysis and Logging. Profiling API and Tools for C, C++, CUDA, Fortran, and Python. The C++ template API is essentially a framework to creating tools: it is designed to provide a unifying interface for recording various performance measurements alongside data logging and interfaces to other tools.
tim::graph< T, AllocatorT >::iterator_base Class Reference

Base class for iterators, only pointers stored, no traversal logic. More...

#include "timemory/storage/graph.hpp"

+ Collaboration diagram for tim::graph< T, AllocatorT >::iterator_base:

Public Types

typedef T value_type
 
typedef T * pointer
 
typedef T & reference
 
typedef size_t size_type
 
typedef ptrdiff_t difference_type
 
typedef std::bidirectional_iterator_tag iterator_category
 

Public Member Functions

 iterator_base ()
 
 iterator_base (graph_node *)
 
 iterator_base (const iterator_base &)=default
 
 iterator_base (iterator_base &&) noexcept=default
 
iterator_baseoperator= (const iterator_base &)=default
 
iterator_baseoperator= (iterator_base &&) noexcept=default
 
 operator bool () const
 
T & operator* () const
 
T * operator-> () const
 
void skip_children ()
 When called, the next increment/decrement skips children of this node. More...
 
void skip_children (bool skip)
 
unsigned int number_of_children () const
 Number of children of the node pointed to by the iterator. More...
 
sibling_iterator begin () const
 
sibling_iterator end () const
 

Public Attributes

graph_nodenode = nullptr
 

Protected Attributes

bool m_skip_current_children = false
 

Detailed Description

template<typename T, typename AllocatorT>
class tim::graph< T, AllocatorT >::iterator_base

Base class for iterators, only pointers stored, no traversal logic.

Definition at line 138 of file graph.hpp.

Member Typedef Documentation

◆ difference_type

template<typename T , typename AllocatorT >
typedef ptrdiff_t tim::graph< T, AllocatorT >::iterator_base::difference_type

Definition at line 145 of file graph.hpp.

◆ iterator_category

template<typename T , typename AllocatorT >
typedef std::bidirectional_iterator_tag tim::graph< T, AllocatorT >::iterator_base::iterator_category

Definition at line 146 of file graph.hpp.

◆ pointer

template<typename T , typename AllocatorT >
typedef T* tim::graph< T, AllocatorT >::iterator_base::pointer

Definition at line 142 of file graph.hpp.

◆ reference

template<typename T , typename AllocatorT >
typedef T& tim::graph< T, AllocatorT >::iterator_base::reference

Definition at line 143 of file graph.hpp.

◆ size_type

template<typename T , typename AllocatorT >
typedef size_t tim::graph< T, AllocatorT >::iterator_base::size_type

Definition at line 144 of file graph.hpp.

◆ value_type

template<typename T , typename AllocatorT >
typedef T tim::graph< T, AllocatorT >::iterator_base::value_type

Definition at line 141 of file graph.hpp.

Constructor & Destructor Documentation

◆ iterator_base() [1/4]

template<typename T , typename AllocatorT >
tim::graph< T, AllocatorT >::iterator_base::iterator_base

Definition at line 2412 of file graph.hpp.

2413: node(nullptr)
2414
2415{}

◆ iterator_base() [2/4]

template<typename T , typename AllocatorT >
tim::graph< T, AllocatorT >::iterator_base::iterator_base ( graph_node tn)

Definition at line 2420 of file graph.hpp.

2421: node(tn)
2422
2423{}

◆ iterator_base() [3/4]

template<typename T , typename AllocatorT >
tim::graph< T, AllocatorT >::iterator_base::iterator_base ( const iterator_base )
default

◆ iterator_base() [4/4]

template<typename T , typename AllocatorT >
tim::graph< T, AllocatorT >::iterator_base::iterator_base ( iterator_base &&  )
defaultnoexcept

Member Function Documentation

◆ begin()

template<typename T , typename AllocatorT >
graph< T, AllocatorT >::sibling_iterator tim::graph< T, AllocatorT >::iterator_base::begin

Definition at line 2507 of file graph.hpp.

2508{
2509 if(node->first_child == nullptr)
2510 return end();
2511
2512 sibling_iterator ret(node->first_child);
2513 ret.m_parent = this->node;
2514 return ret;
2515}
sibling_iterator end() const
Definition: graph.hpp:2521
tgraph_node< T > * first_child
Definition: graph.hpp:79

References tim::graph< T, AllocatorT >::end(), and tim::graph< T, AllocatorT >::sibling_iterator::m_parent.

Referenced by tim::graph< T, AllocatorT >::graph(), tim::graph< T, AllocatorT >::empty(), tim::graph< T, AllocatorT >::equal_subgraph(), tim::graph< T, AllocatorT >::merge(), and tim::graph< T, AllocatorT >::serialize().

◆ end()

template<typename T , typename AllocatorT >
graph< T, AllocatorT >::sibling_iterator tim::graph< T, AllocatorT >::iterator_base::end

◆ number_of_children()

template<typename T , typename AllocatorT >
unsigned int tim::graph< T, AllocatorT >::iterator_base::number_of_children

Number of children of the node pointed to by the iterator.

Definition at line 2550 of file graph.hpp.

2551{
2553 if(pos == nullptr)
2554 return 0;
2555
2556 unsigned int ret = 1;
2557 while(pos != node->last_child)
2558 {
2559 ++ret;
2560 pos = pos->next_sibling;
2561 }
2562 return ret;
2563}
tgraph_node< T > graph_node
Definition: graph.hpp:117
tgraph_node< T > * last_child
Definition: graph.hpp:80
size_t pos
Definition: config.cpp:102

References tim::pos.

Referenced by tim::graph< T, AllocatorT >::equal(), and tim::graph< T, AllocatorT >::equal_subgraph().

◆ operator bool()

template<typename T , typename AllocatorT >
tim::graph< T, AllocatorT >::iterator_base::operator bool ( ) const
inline

Definition at line 159 of file graph.hpp.

159{ return node != nullptr; }

◆ operator*()

template<typename T , typename AllocatorT >
T & tim::graph< T, AllocatorT >::iterator_base::operator*

Definition at line 2428 of file graph.hpp.

2429{
2430 return node->data;
2431}

◆ operator->()

template<typename T , typename AllocatorT >
T * tim::graph< T, AllocatorT >::iterator_base::operator->

Definition at line 2436 of file graph.hpp.

2437{
2438 return &(node->data);
2439}

◆ operator=() [1/2]

template<typename T , typename AllocatorT >
iterator_base & tim::graph< T, AllocatorT >::iterator_base::operator= ( const iterator_base )
default

◆ operator=() [2/2]

template<typename T , typename AllocatorT >
iterator_base & tim::graph< T, AllocatorT >::iterator_base::operator= ( iterator_base &&  )
defaultnoexcept

◆ skip_children() [1/2]

template<typename T , typename AllocatorT >
void tim::graph< T, AllocatorT >::iterator_base::skip_children

When called, the next increment/decrement skips children of this node.

Definition at line 2532 of file graph.hpp.

2533{
2535}

Referenced by tim::graph< T, AllocatorT >::pre_order_iterator::pre_order_iterator().

◆ skip_children() [2/2]

template<typename T , typename AllocatorT >
void tim::graph< T, AllocatorT >::iterator_base::skip_children ( bool  skip)

Definition at line 2541 of file graph.hpp.

2542{
2544}

Member Data Documentation

◆ m_skip_current_children

template<typename T , typename AllocatorT >
bool tim::graph< T, AllocatorT >::iterator_base::m_skip_current_children = false
protected

Definition at line 182 of file graph.hpp.

◆ node


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