OmniSciDB  7bf56492aa
 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 1241 of file RelAlgDagBuilder.cpp.

Member Typedef Documentation

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

Definition at line 1244 of file RelAlgDagBuilder.cpp.

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

Definition at line 1242 of file RelAlgDagBuilder.cpp.

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

Definition at line 1243 of file RelAlgDagBuilder.cpp.

Member Enumeration Documentation

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

Definition at line 1247 of file RelAlgDagBuilder.cpp.

1247 { DUChain, InOrder };

Member Function Documentation

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

Definition at line 1266 of file RelAlgDagBuilder.cpp.

References CHECK().

1266  {
1267  Super& super = *this;
1268  switch (mode) {
1269  case AdvancingMode::DUChain: {
1270  size_t use_count = 0;
1271  Super only_use = owner_.end();
1272  for (Super nodeIt = std::next(super); nodeIt != owner_.end(); ++nodeIt) {
1273  if (!*nodeIt) {
1274  continue;
1275  }
1276  for (size_t i = 0; i < (*nodeIt)->inputCount(); ++i) {
1277  if ((*super) == (*nodeIt)->getAndOwnInput(i)) {
1278  ++use_count;
1279  if (1 == use_count) {
1280  only_use = nodeIt;
1281  } else {
1282  super = owner_.end();
1283  return;
1284  }
1285  }
1286  }
1287  }
1288  super = only_use;
1289  break;
1290  }
1292  for (size_t i = 0; i != owner_.size(); ++i) {
1293  if (!visited_.count(i)) {
1294  super = owner_.begin();
1295  std::advance(super, i);
1296  return;
1297  }
1298  }
1299  super = owner_.end();
1300  break;
1301  default:
1302  CHECK(false);
1303  }
1304  }
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 1306 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 1308 of file RelAlgDagBuilder.cpp.

1308  {
1309  visited_.insert(size_t(*this));
1310  Super& super = *this;
1311  return *super;
1312  }
std::vector< ElementType >::const_iterator Super
const ElementType* anonymous_namespace{RelAlgDagBuilder.cpp}::RANodeIterator::operator-> ( )
inline

Definition at line 1314 of file RelAlgDagBuilder.cpp.

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

Member Data Documentation

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

Definition at line 1252 of file RelAlgDagBuilder.cpp.

1252  : nodes) {
1253  if (node) {
1254  ++non_zero_count;
1255  }
1256  }
const size_t anonymous_namespace{RelAlgDagBuilder.cpp}::RANodeIterator::nodeCount_
private

Definition at line 1318 of file RelAlgDagBuilder.cpp.

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

Definition at line 1257 of file RelAlgDagBuilder.cpp.

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

Definition at line 1317 of file RelAlgDagBuilder.cpp.

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

Definition at line 1319 of file RelAlgDagBuilder.cpp.


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