OmniSciDB  0bd2ec9cf4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 1194 of file RelAlgDagBuilder.cpp.

Member Typedef Documentation

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

Definition at line 1197 of file RelAlgDagBuilder.cpp.

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

Definition at line 1195 of file RelAlgDagBuilder.cpp.

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

Definition at line 1196 of file RelAlgDagBuilder.cpp.

Member Enumeration Documentation

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

Definition at line 1200 of file RelAlgDagBuilder.cpp.

1200 { DUChain, InOrder };

Member Function Documentation

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

Definition at line 1219 of file RelAlgDagBuilder.cpp.

References CHECK().

1219  {
1220  Super& super = *this;
1221  switch (mode) {
1222  case AdvancingMode::DUChain: {
1223  size_t use_count = 0;
1224  Super only_use = owner_.end();
1225  for (Super nodeIt = std::next(super); nodeIt != owner_.end(); ++nodeIt) {
1226  if (!*nodeIt) {
1227  continue;
1228  }
1229  for (size_t i = 0; i < (*nodeIt)->inputCount(); ++i) {
1230  if ((*super) == (*nodeIt)->getAndOwnInput(i)) {
1231  ++use_count;
1232  if (1 == use_count) {
1233  only_use = nodeIt;
1234  } else {
1235  super = owner_.end();
1236  return;
1237  }
1238  }
1239  }
1240  }
1241  super = only_use;
1242  break;
1243  }
1245  for (size_t i = 0; i != owner_.size(); ++i) {
1246  if (!visited_.count(i)) {
1247  super = owner_.begin();
1248  std::advance(super, i);
1249  return;
1250  }
1251  }
1252  super = owner_.end();
1253  break;
1254  default:
1255  CHECK(false);
1256  }
1257  }
CHECK(cgen_state)
std::vector< ElementType >::const_iterator Super

+ Here is the call graph for this function:

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

Definition at line 1259 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 1261 of file RelAlgDagBuilder.cpp.

1261  {
1262  visited_.insert(size_t(*this));
1263  Super& super = *this;
1264  return *super;
1265  }
std::vector< ElementType >::const_iterator Super
const ElementType* anonymous_namespace{RelAlgDagBuilder.cpp}::RANodeIterator::operator-> ( )
inline

Definition at line 1267 of file RelAlgDagBuilder.cpp.

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

Member Data Documentation

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

Definition at line 1205 of file RelAlgDagBuilder.cpp.

1205  : nodes) {
1206  if (node) {
1207  ++non_zero_count;
1208  }
1209  }
const size_t anonymous_namespace{RelAlgDagBuilder.cpp}::RANodeIterator::nodeCount_
private

Definition at line 1271 of file RelAlgDagBuilder.cpp.

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

Definition at line 1210 of file RelAlgDagBuilder.cpp.

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

Definition at line 1270 of file RelAlgDagBuilder.cpp.

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

Definition at line 1272 of file RelAlgDagBuilder.cpp.


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