sps::SparseSetTest< TSet, TIterator > Class Template Reference

A class for running sparse set tests. More...

#include <SparseSetTest.h>

List of all members.

Public Member Functions

int Test (const char *psLogFile, size_t nLoops)
 Executes all operations of psLogFile nLoops times.


Detailed Description

template<class TSet, class TIterator = TSet::Iterator>
class sps::SparseSetTest< TSet, TIterator >

A class for running sparse set tests.

TSet is the concrete BitSet implementation to test and TIterator its iterator (you usually don't need to overwrite its default value). To run the tests only a call to Test() is needed.

Example:

                SparseSetTest< sps::BitList > spstest;
                spstest.Test("logfile.txt", 3); // this will run the tests of logfile.txt 3 times


Member Function Documentation

template<class TSet, class TIterator = TSet::Iterator>
int sps::SparseSetTest< TSet, TIterator >::Test ( const char *  psLogFile,
size_t  nLoops 
) [inline]

Executes all operations of psLogFile nLoops times.

Each line of psLogFile must match the Line production (see below). The Id at the beginning of each line identifies the object. Commands of an object are only allowed if the Id of the object is valid. An Id starts to be valid on a constructor call ('SparseSet()' and 'Iterator()') and ends to be valid on a destructor call ('~SparseSet()' and '~Iterator()'). An Id constructed with the 'SparseSet()' constructor is only valid for SPSCommands and an Id constructed with the 'Iterator()' constructor only for ItCommands.

An 'Iterator()' constructor must directly follow each 'GetIterator()' command. This iterator is the result of the 'GetIterator()' call. Each command represents a call to the equal-named method in one of the SparseSet implementations or their Iterator implementation, respectivly. The iterator 'End()' command represents sps::Iterator::HasMoreElements() and 'Dereference()' sps::Iterator::operator*().

                Line        := Id ':' Command
                Id          := [0-9a-fA-F]+
                Command     := SPSCommand | ItCommand
                SPSCommand  := 'SparseSet::' ( SPSNoArgCmd | SPSValueCmd | SPSIdCmd )
                SPSNoArgCmd := ( 'SparseSet()' | '~SparseSet()' | 'GetIterator()' | 'IsEmpty()' )
                SPSValueCmd := ( 'Add(' | 'Contains(' | 'Remove(' ) Value ')'
                Value       := [0-9]+
                SPSIdCmd    := ( 'Union(' | 'Intersect(' | 'Difference(' | 'Copy(' | 'IsEqual(' ) Id ')'
                ItCommand   := 'Iterator::' ( 'Iterator()'  | 
                                              '~Iterator()' | 
                                              'Begin()'     |
                                              'Next()'      |
                                              'End()'       | 
                                              'Dereference()' )


The documentation for this class was generated from the following file:
Generated on Wed Jun 20 21:20:43 2007 for SparseSet by  doxygen 1.5.2