OmniSciDB  6686921089
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
anonymous_namespace{RelAlgDagBuilder.cpp}::RANodeIterator Class Reference
+ Inheritance diagram for anonymous_namespace{RelAlgDagBuilder.cpp}::RANodeIterator:
+ Collaboration diagram for anonymous_namespace{RelAlgDagBuilder.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 1469 of file RelAlgDagBuilder.cpp.

Member Typedef Documentation

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

Definition at line 1472 of file RelAlgDagBuilder.cpp.

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

Definition at line 1470 of file RelAlgDagBuilder.cpp.

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

Definition at line 1471 of file RelAlgDagBuilder.cpp.

Member Enumeration Documentation

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

Definition at line 1475 of file RelAlgDagBuilder.cpp.

1475 { DUChain, InOrder };

Member Function Documentation

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

Definition at line 1494 of file RelAlgDagBuilder.cpp.

References CHECK, and i.

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().

1494  {
1495  Super& super = *this;
1496  switch (mode) {
1497  case AdvancingMode::DUChain: {
1498  size_t use_count = 0;
1499  Super only_use = owner_.end();
1500  for (Super nodeIt = std::next(super); nodeIt != owner_.end(); ++nodeIt) {
1501  if (!*nodeIt) {
1502  continue;
1503  }
1504  for (size_t i = 0; i < (*nodeIt)->inputCount(); ++i) {
1505  if ((*super) == (*nodeIt)->getAndOwnInput(i)) {
1506  ++use_count;
1507  if (1 == use_count) {
1508  only_use = nodeIt;
1509  } else {
1510  super = owner_.end();
1511  return;
1512  }
1513  }
1514  }
1515  }
1516  super = only_use;
1517  break;
1518  }
1520  for (size_t i = 0; i != owner_.size(); ++i) {
1521  if (!visited_.count(i)) {
1522  super = owner_.begin();
1523  std::advance(super, i);
1524  return;
1525  }
1526  }
1527  super = owner_.end();
1528  break;
1529  default:
1530  CHECK(false);
1531  }
1532  }
std::vector< ElementType >::const_iterator Super
#define CHECK(condition)
Definition: Logger.h:209

+ Here is the caller graph for this function:

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

Definition at line 1534 of file RelAlgDagBuilder.cpp.

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

+ Here is the caller graph for this function:

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

Definition at line 1536 of file RelAlgDagBuilder.cpp.

1536  {
1537  visited_.insert(size_t(*this));
1538  Super& super = *this;
1539  return *super;
1540  }
std::vector< ElementType >::const_iterator Super
const ElementType* anonymous_namespace{RelAlgDagBuilder.cpp}::RANodeIterator::operator-> ( )
inline

Definition at line 1542 of file RelAlgDagBuilder.cpp.

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

Member Data Documentation

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

Definition at line 1480 of file RelAlgDagBuilder.cpp.

1480  : nodes) {
1481  if (node) {
1482  ++non_zero_count;
1483  }
1484  }
const size_t anonymous_namespace{RelAlgDagBuilder.cpp}::RANodeIterator::nodeCount_
private

Definition at line 1546 of file RelAlgDagBuilder.cpp.

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

Definition at line 1485 of file RelAlgDagBuilder.cpp.

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

Definition at line 1545 of file RelAlgDagBuilder.cpp.

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

Definition at line 1547 of file RelAlgDagBuilder.cpp.


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