OmniSciDB  72c90bc290
 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 1839 of file RelAlgDag.cpp.

Member Typedef Documentation

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

Definition at line 1842 of file RelAlgDag.cpp.

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

Definition at line 1840 of file RelAlgDag.cpp.

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

Definition at line 1841 of file RelAlgDag.cpp.

Member Enumeration Documentation

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

Definition at line 1845 of file RelAlgDag.cpp.

1845 { DUChain, InOrder };

Member Function Documentation

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

Definition at line 1864 of file RelAlgDag.cpp.

References CHECK.

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

1864  {
1865  Super& super = *this;
1866  switch (mode) {
1867  case AdvancingMode::DUChain: {
1868  size_t use_count = 0;
1869  Super only_use = owner_.end();
1870  for (Super nodeIt = std::next(super); nodeIt != owner_.end(); ++nodeIt) {
1871  if (!*nodeIt) {
1872  continue;
1873  }
1874  for (size_t i = 0; i < (*nodeIt)->inputCount(); ++i) {
1875  if ((*super) == (*nodeIt)->getAndOwnInput(i)) {
1876  ++use_count;
1877  if (1 == use_count) {
1878  only_use = nodeIt;
1879  } else {
1880  super = owner_.end();
1881  return;
1882  }
1883  }
1884  }
1885  }
1886  super = only_use;
1887  break;
1888  }
1890  for (size_t i = 0; i != owner_.size(); ++i) {
1891  if (!visited_.count(i)) {
1892  super = owner_.begin();
1893  std::advance(super, i);
1894  return;
1895  }
1896  }
1897  super = owner_.end();
1898  break;
1899  default:
1900  CHECK(false);
1901  }
1902  }
std::vector< ElementType >::const_iterator Super
Definition: RelAlgDag.cpp:1841
#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 1904 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 1906 of file RelAlgDag.cpp.

1906  {
1907  visited_.insert(size_t(*this));
1908  Super& super = *this;
1909  return *super;
1910  }
std::vector< ElementType >::const_iterator Super
Definition: RelAlgDag.cpp:1841
const ElementType* anonymous_namespace{RelAlgDag.cpp}::RANodeIterator::operator-> ( )
inline

Definition at line 1912 of file RelAlgDag.cpp.

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

Member Data Documentation

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

Definition at line 1850 of file RelAlgDag.cpp.

1850  : nodes) {
1851  if (node) {
1852  ++non_zero_count;
1853  }
1854  }
const size_t anonymous_namespace{RelAlgDag.cpp}::RANodeIterator::nodeCount_
private

Definition at line 1916 of file RelAlgDag.cpp.

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

Definition at line 1855 of file RelAlgDag.cpp.

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

Definition at line 1915 of file RelAlgDag.cpp.

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

Definition at line 1917 of file RelAlgDag.cpp.


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