OmniSciDB  a5dc49c757
 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 1842 of file RelAlgDag.cpp.

Member Typedef Documentation

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

Definition at line 1845 of file RelAlgDag.cpp.

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

Definition at line 1843 of file RelAlgDag.cpp.

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

Definition at line 1844 of file RelAlgDag.cpp.

Member Enumeration Documentation

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

Definition at line 1848 of file RelAlgDag.cpp.

1848 { DUChain, InOrder };

Member Function Documentation

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

Definition at line 1867 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().

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

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

Definition at line 1915 of file RelAlgDag.cpp.

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

Member Data Documentation

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

Definition at line 1853 of file RelAlgDag.cpp.

1853  : nodes) {
1854  if (node) {
1855  ++non_zero_count;
1856  }
1857  }
const size_t anonymous_namespace{RelAlgDag.cpp}::RANodeIterator::nodeCount_
private

Definition at line 1919 of file RelAlgDag.cpp.

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

Definition at line 1858 of file RelAlgDag.cpp.

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

Definition at line 1918 of file RelAlgDag.cpp.

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

Definition at line 1920 of file RelAlgDag.cpp.


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