yosys-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
RTLIL::ObjIterator< T > Struct Template Reference

#include <rtlil.h>

Public Member Functions

 ObjIterator ()
 
 ObjIterator (decltype(list_p) list_p, int *refcount_p)
 
 ObjIterator (const RTLIL::ObjIterator< T > &other)
 
ObjIteratoroperator= (const RTLIL::ObjIterator< T > &other)
 
 ~ObjIterator ()
 
operator* () const
 
bool operator!= (const RTLIL::ObjIterator< T > &other) const
 
void operator++ ()
 

Data Fields

std::map< RTLIL::IdString, T >
::iterator 
it
 
std::map< RTLIL::IdString, T > * list_p
 
int * refcount_p
 

Detailed Description

template<typename T>
struct RTLIL::ObjIterator< T >

Definition at line 337 of file rtlil.h.

Constructor & Destructor Documentation

template<typename T>
RTLIL::ObjIterator< T >::ObjIterator ( )
inline

Definition at line 343 of file rtlil.h.

343  : list_p(nullptr), refcount_p(nullptr) {
344  }
int * refcount_p
Definition: rtlil.h:341
std::map< RTLIL::IdString, T > * list_p
Definition: rtlil.h:340
template<typename T>
RTLIL::ObjIterator< T >::ObjIterator ( decltype(list_p list_p,
int *  refcount_p 
)
inline

Definition at line 346 of file rtlil.h.

347  if (list_p->empty()) {
348  this->list_p = nullptr;
349  this->refcount_p = nullptr;
350  } else {
351  it = list_p->begin();
352  (*refcount_p)++;
353  }
354  }
std::map< RTLIL::IdString, T >::iterator it
Definition: rtlil.h:339
int * refcount_p
Definition: rtlil.h:341
std::map< RTLIL::IdString, T > * list_p
Definition: rtlil.h:340
template<typename T>
RTLIL::ObjIterator< T >::ObjIterator ( const RTLIL::ObjIterator< T > &  other)
inline

Definition at line 356 of file rtlil.h.

356  {
357  it = other.it;
358  list_p = other.list_p;
359  refcount_p = other.refcount_p;
360  if (refcount_p)
361  (*refcount_p)++;
362  }
std::map< RTLIL::IdString, T >::iterator it
Definition: rtlil.h:339
int * refcount_p
Definition: rtlil.h:341
std::map< RTLIL::IdString, T > * list_p
Definition: rtlil.h:340
template<typename T>
RTLIL::ObjIterator< T >::~ObjIterator ( )
inline

Definition at line 375 of file rtlil.h.

375  {
376  if (refcount_p)
377  (*refcount_p)--;
378  }
int * refcount_p
Definition: rtlil.h:341

Member Function Documentation

template<typename T>
bool RTLIL::ObjIterator< T >::operator!= ( const RTLIL::ObjIterator< T > &  other) const
inline

Definition at line 385 of file rtlil.h.

385  {
386  if (list_p == nullptr || other.list_p == nullptr)
387  return list_p != other.list_p;
388  return it != other.it;
389  }
std::map< RTLIL::IdString, T >::iterator it
Definition: rtlil.h:339
std::map< RTLIL::IdString, T > * list_p
Definition: rtlil.h:340
template<typename T>
T RTLIL::ObjIterator< T >::operator* ( ) const
inline

Definition at line 380 of file rtlil.h.

380  {
381  log_assert(list_p != nullptr);
382  return it->second;
383  }
std::map< RTLIL::IdString, T >::iterator it
Definition: rtlil.h:339
#define log_assert(_assert_expr_)
Definition: log.h:85
std::map< RTLIL::IdString, T > * list_p
Definition: rtlil.h:340
template<typename T>
void RTLIL::ObjIterator< T >::operator++ ( )
inline

Definition at line 391 of file rtlil.h.

391  {
392  log_assert(list_p != nullptr);
393  if (++it == list_p->end()) {
394  (*refcount_p)--;
395  list_p = nullptr;
396  refcount_p = nullptr;
397  }
398  }
std::map< RTLIL::IdString, T >::iterator it
Definition: rtlil.h:339
#define log_assert(_assert_expr_)
Definition: log.h:85
int * refcount_p
Definition: rtlil.h:341
std::map< RTLIL::IdString, T > * list_p
Definition: rtlil.h:340
template<typename T>
ObjIterator& RTLIL::ObjIterator< T >::operator= ( const RTLIL::ObjIterator< T > &  other)
inline

Definition at line 364 of file rtlil.h.

364  {
365  if (refcount_p)
366  (*refcount_p)--;
367  it = other.it;
368  list_p = other.list_p;
369  refcount_p = other.refcount_p;
370  if (refcount_p)
371  (*refcount_p)++;
372  return *this;
373  }
std::map< RTLIL::IdString, T >::iterator it
Definition: rtlil.h:339
int * refcount_p
Definition: rtlil.h:341
std::map< RTLIL::IdString, T > * list_p
Definition: rtlil.h:340

Field Documentation

template<typename T>
std::map<RTLIL::IdString, T>::iterator RTLIL::ObjIterator< T >::it

Definition at line 339 of file rtlil.h.

template<typename T>
std::map<RTLIL::IdString, T>* RTLIL::ObjIterator< T >::list_p

Definition at line 340 of file rtlil.h.

template<typename T>
int* RTLIL::ObjIterator< T >::refcount_p

Definition at line 341 of file rtlil.h.


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