HLIBpro  3.0
TNodeSet Class Reference

Represents a set of nodes by an array. More...

#include <TNodeSet.hh>

Classes

class  iterator
 STL iterator for TNodeSet. More...
 

Public Member Functions

 TNodeSet (const size_t set_size=0)
 construct node set with maximal capacity set_size
 
 TNodeSet (const TNodeSet &set)
 copy ctor
 
size_t size () const noexcept
 return capacity of node set
 
node_toperator[] (const size_t i) noexcept
 return i'th node in set
 
iterator begin () const noexcept
 return STL iterators
 
const_iterator cbegin () const noexcept
 return STL const iterators
 
size_t nnodes () const noexcept
 return number of stored nodes
 
void set_nnodes (const size_t n) noexcept
 directly set number of stored nodes
 
void append (const node_t node)
 append node node to the set (without incrementing the array-size)
 
void remove_all () noexcept
 remove all nodes from set (array-size is not changed)
 
void resize (const size_t n, const bool=true)
 adjust capacity to n and node number
 
void resize (const size_t n, const uint &, const bool)
 adjust capacity to n and node number
 
TNodeSetoperator= (const TNodeSet &set)
 copy operator
 

Protected Attributes

std::vector< node_t_data
 array containing nodeset
 
size_t _nnodes
 actual number of nodes in set
 

Detailed Description

  • maximal size of nodeset, e.g. the capacity, is equal to array-size
  • current number of members is equal to _n_nodes