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

Member Typedef Documentation

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

Definition at line 1182 of file RelAlgAbstractInterpreter.cpp.

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

Definition at line 1180 of file RelAlgAbstractInterpreter.cpp.

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

Definition at line 1181 of file RelAlgAbstractInterpreter.cpp.

Member Enumeration Documentation

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

Definition at line 1185 of file RelAlgAbstractInterpreter.cpp.

1185 { DUChain, InOrder };

Member Function Documentation

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

Definition at line 1204 of file RelAlgAbstractInterpreter.cpp.

References CHECK().

1204  {
1205  Super& super = *this;
1206  switch (mode) {
1207  case AdvancingMode::DUChain: {
1208  size_t use_count = 0;
1209  Super only_use = owner_.end();
1210  for (Super nodeIt = std::next(super); nodeIt != owner_.end(); ++nodeIt) {
1211  if (!*nodeIt) {
1212  continue;
1213  }
1214  for (size_t i = 0; i < (*nodeIt)->inputCount(); ++i) {
1215  if ((*super) == (*nodeIt)->getAndOwnInput(i)) {
1216  ++use_count;
1217  if (1 == use_count) {
1218  only_use = nodeIt;
1219  } else {
1220  super = owner_.end();
1221  return;
1222  }
1223  }
1224  }
1225  }
1226  super = only_use;
1227  break;
1228  }
1230  for (size_t i = 0; i != owner_.size(); ++i) {
1231  if (!visited_.count(i)) {
1232  super = owner_.begin();
1233  std::advance(super, i);
1234  return;
1235  }
1236  }
1237  super = owner_.end();
1238  break;
1239  default:
1240  CHECK(false);
1241  }
1242  }
CHECK(cgen_state)

+ Here is the call graph for this function:

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

Definition at line 1244 of file RelAlgAbstractInterpreter.cpp.

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

+ Here is the caller graph for this function:

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

Definition at line 1246 of file RelAlgAbstractInterpreter.cpp.

1246  {
1247  visited_.insert(size_t(*this));
1248  Super& super = *this;
1249  return *super;
1250  }
const ElementType* anonymous_namespace{RelAlgAbstractInterpreter.cpp}::RANodeIterator::operator-> ( )
inline

Member Data Documentation

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

Definition at line 1190 of file RelAlgAbstractInterpreter.cpp.

1190  : nodes) {
1191  if (node) {
1192  ++non_zero_count;
1193  }
1194  }
const size_t anonymous_namespace{RelAlgAbstractInterpreter.cpp}::RANodeIterator::nodeCount_
private

Definition at line 1256 of file RelAlgAbstractInterpreter.cpp.

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

Definition at line 1195 of file RelAlgAbstractInterpreter.cpp.

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

Definition at line 1255 of file RelAlgAbstractInterpreter.cpp.

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

Definition at line 1257 of file RelAlgAbstractInterpreter.cpp.


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