Generated on Tue Dec 16 13:34:02 2008 for ell-3.0.0 by doxygen 1.5.1

src/ell/SC_Counting.cc

Go to the documentation of this file.
00001 #include "ell/StateCollector.hh"
00002 
00003 namespace ell
00004 {
00005 
00006     SC_Counting::SC_Counting()
00007      :  lastAdded(NULL), stateCount(0)
00008     {
00009     }
00010     
00011     SC_Counting::~SC_Counting()
00012     {
00013         if (lastAdded != NULL) {
00014             delete lastAdded;
00015             lastAdded = NULL;
00016         }
00017     }
00018 
00019       // This function is used to track all added States.
00020       // @param s the State to add
00021     void 
00022     SC_Counting::add(const State& s) {
00023         lastAdded = s.clone(lastAdded);
00024         stateCount++;
00025     }
00026     
00027       // Returns number of added States.
00028       // @return the number of added states
00029     size_t 
00030     SC_Counting::size() const {
00031         return stateCount;
00032     }
00033      
00034       // Returns last added State.
00035       // @return the last added State
00036     const State* const 
00037     SC_Counting::getLastAdded() const {
00038         return lastAdded;
00039     }
00040     
00041 }