XACC
Public Member Functions | Protected Attributes | List of all members
xacc::InstructionIterator Class Reference

#include <InstructionIterator.hpp>

Public Member Functions

 InstructionIterator (std::shared_ptr< Instruction > r)
 
bool hasNext ()
 
std::shared_ptr< Instructionnext ()
 

Protected Attributes

std::shared_ptr< Instructionroot
 
std::stack< std::shared_ptr< Instruction > > instStack
 

Detailed Description

The InstructionIterator provides a mechanism for a pre-order traversal of an Instruction tree.

Constructor & Destructor Documentation

xacc::InstructionIterator::InstructionIterator ( std::shared_ptr< Instruction r)
inline

The constructor, takes the root of the tree as input.

Parameters
r

Member Function Documentation

bool xacc::InstructionIterator::hasNext ( )
inline

Return true if there are still instructions left to traverse.

Returns
std::shared_ptr<Instruction> xacc::InstructionIterator::next ( )
inline

Return the next Instruction in the tree.

Returns

Member Data Documentation

std::stack<std::shared_ptr<Instruction> > xacc::InstructionIterator::instStack
protected

A stack used to implement the tree traversal

std::shared_ptr<Instruction> xacc::InstructionIterator::root
protected

The root of the tree, a function


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