The StateQueue class is a SortedList instantiated with BasicState *'s as the type of object to be handled. The comparison function given to the SortedList is a comparison for BasicStates, allowing the sorting to occur based on lVTs.
Like the InputQueue and OutputQueue class, the StateQueue class has a function called gcollect(VTime) that is responsible for the removal of all states in the queue before the VTime passed in. In the StateQueue however, one state before this time must be saved as well. This is to ensure that if a rollback to gVT occurs, the state immediately before gVT can be restored. Like the OutputQueue, the StateQueue must delete the data from Containers it removes.
Here is the interface of the StateQueue class:
class StateQueue : public SortedList< BasicState>{
public:
StateQueue(){
setFunc( BasicStateCompare );
}
BasicState* find(VTime, findMode_t );
VTime gcollect(VTime);
};