KInstIterator.h

Go to the documentation of this file.
00001 //===-- KInstIterator.h -----------------------------------------*- C++ -*-===//
00002 //
00003 //                     The KLEE Symbolic Virtual Machine
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 
00010 #ifndef KLEE_KINSTITERATOR_H
00011 #define KLEE_KINSTITERATOR_H
00012 
00013 namespace klee {
00014   class KInstruction;
00015 
00016   class KInstIterator {
00017     KInstruction **it;
00018 
00019   public:
00020     KInstIterator() : it(0) {}
00021     KInstIterator(KInstruction **_it) : it(_it) {}
00022     KInstIterator(const KInstIterator &b) : it(b.it) {}
00023     ~KInstIterator() {}
00024 
00025     KInstIterator &operator=(const KInstIterator &b) {
00026       it = b.it;
00027       return *this;
00028     }
00029 
00030     bool operator==(const KInstIterator &b) const {
00031       return it==b.it;
00032     }
00033     bool operator!=(const KInstIterator &b) const {
00034       return !(*this == b);
00035     }
00036 
00037     KInstIterator &operator++() {
00038       ++it;
00039       return *this;
00040     }
00041 
00042     operator KInstruction*() const { return it ? *it : 0;}
00043     operator bool() const { return it != 0; }
00044 
00045     KInstruction *operator ->() const { return *it; }
00046   };
00047 } // End klee namespace
00048 
00049 #endif

Generated on Fri Jun 5 03:31:31 2009 for klee by  doxygen 1.5.8