OmniSciDB  c1a53651b2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
anonymous_namespace{RelAlgDag.cpp}::RANodeIterator Class Reference
+ Inheritance diagram for anonymous_namespace{RelAlgDag.cpp}::RANodeIterator:
+ Collaboration diagram for anonymous_namespace{RelAlgDag.cpp}::RANodeIterator:

Public Types

enum  AdvancingMode { AdvancingMode::DUChain, AdvancingMode::InOrder }
 

Public Member Functions

void advance (AdvancingMode mode)
 
bool allVisited ()
 
const ElementTypeoperator* ()
 
const ElementTypeoperator-> ()
 

Public Attributes

RANodeIterator(const Container
&nodes) 
for (const auto &node:nodes)
 
return non_zero_count
 

Private Types

using ElementType = std::shared_ptr< RelAlgNode >
 
using Super = std::vector< ElementType >::const_iterator
 
using Container = std::vector< ElementType >
 

Private Attributes

const Containerowner_
 
const size_t nodeCount_
 
std::unordered_set< size_t > visited_
 

Detailed Description

Definition at line 1808 of file RelAlgDag.cpp.

Member Typedef Documentation

using anonymous_namespace{RelAlgDag.cpp}::RANodeIterator::Container = std::vector<ElementType>
private

Definition at line 1811 of file RelAlgDag.cpp.

using anonymous_namespace{RelAlgDag.cpp}::RANodeIterator::ElementType = std::shared_ptr<RelAlgNode>
private

Definition at line 1809 of file RelAlgDag.cpp.

using anonymous_namespace{RelAlgDag.cpp}::RANodeIterator::Super = std::vector<ElementType>::const_iterator
private

Definition at line 1810 of file RelAlgDag.cpp.

Member Enumeration Documentation

enum anonymous_namespace{RelAlgDag.cpp}::RANodeIterator::AdvancingMode
strong
Enumerator
DUChain 
InOrder 

Definition at line 1814 of file RelAlgDag.cpp.

1814 { DUChain, InOrder };

Member Function Documentation

void anonymous_namespace{RelAlgDag.cpp}::RANodeIterator::advance ( AdvancingMode  mode)
inline

Definition at line 1833 of file RelAlgDag.cpp.

References CHECK.

Referenced by generate_TableFunctionsFactory_init.Parser::consume(), generate_TableFunctionsFactory_init.Tokenize::consume_double_char(), generate_TableFunctionsFactory_init.Tokenize::consume_identifier(), generate_TableFunctionsFactory_init.Tokenize::consume_number(), generate_TableFunctionsFactory_init.Tokenize::consume_single_char(), generate_TableFunctionsFactory_init.Tokenize::consume_string(), generate_TableFunctionsFactory_init.Tokenize::consume_whitespace(), and generate_TableFunctionsFactory_init.Parser::expect().

1833  {
1834  Super& super = *this;
1835  switch (mode) {
1836  case AdvancingMode::DUChain: {
1837  size_t use_count = 0;
1838  Super only_use = owner_.end();
1839  for (Super nodeIt = std::next(super); nodeIt != owner_.end(); ++nodeIt) {
1840  if (!*nodeIt) {
1841  continue;
1842  }
1843  for (size_t i = 0; i < (*nodeIt)->inputCount(); ++i) {
1844  if ((*super) == (*nodeIt)->getAndOwnInput(i)) {
1845  ++use_count;
1846  if (1 == use_count) {
1847  only_use = nodeIt;
1848  } else {
1849  super = owner_.end();
1850  return;
1851  }
1852  }
1853  }
1854  }
1855  super = only_use;
1856  break;
1857  }
1859  for (size_t i = 0; i != owner_.size(); ++i) {
1860  if (!visited_.count(i)) {
1861  super = owner_.begin();
1862  std::advance(super, i);
1863  return;
1864  }
1865  }
1866  super = owner_.end();
1867  break;
1868  default:
1869  CHECK(false);
1870  }
1871  }
std::vector< ElementType >::const_iterator Super
Definition: RelAlgDag.cpp:1810
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the caller graph for this function:

bool anonymous_namespace{RelAlgDag.cpp}::RANodeIterator::allVisited ( )
inline

Definition at line 1873 of file RelAlgDag.cpp.

Referenced by anonymous_namespace{RelAlgDag.cpp}::coalesce_nodes().

+ Here is the caller graph for this function:

const ElementType& anonymous_namespace{RelAlgDag.cpp}::RANodeIterator::operator* ( )
inline

Definition at line 1875 of file RelAlgDag.cpp.

1875  {
1876  visited_.insert(size_t(*this));
1877  Super& super = *this;
1878  return *super;
1879  }
std::vector< ElementType >::const_iterator Super
Definition: RelAlgDag.cpp:1810
const ElementType* anonymous_namespace{RelAlgDag.cpp}::RANodeIterator::operator-> ( )
inline

Definition at line 1881 of file RelAlgDag.cpp.

1881 { return &(operator*()); }

Member Data Documentation

RANodeIterator (const Container& nodes) anonymous_namespace{RelAlgDag.cpp}::RANodeIterator::for(const auto &node:nodes)
inlineexplicit

Definition at line 1819 of file RelAlgDag.cpp.

1819  : nodes) {
1820  if (node) {
1821  ++non_zero_count;
1822  }
1823  }
const size_t anonymous_namespace{RelAlgDag.cpp}::RANodeIterator::nodeCount_
private

Definition at line 1885 of file RelAlgDag.cpp.

return anonymous_namespace{RelAlgDag.cpp}::RANodeIterator::non_zero_count

Definition at line 1824 of file RelAlgDag.cpp.

const Container& anonymous_namespace{RelAlgDag.cpp}::RANodeIterator::owner_
private

Definition at line 1884 of file RelAlgDag.cpp.

std::unordered_set<size_t> anonymous_namespace{RelAlgDag.cpp}::RANodeIterator::visited_
private

Definition at line 1886 of file RelAlgDag.cpp.


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