Skip to content
Snippets Groups Projects
ISR.h 931 B
Newer Older
  • Learn to ignore specific revisions
  • jsclose's avatar
    jsclose committed
    #include <fcntl.h>
    #include <stdio.h>
    #include <string.h>
    #include <unistd.h>
    #include <sys/mman.h>
    #include <sys/stat.h>
    #include <sys/types.h>
    
    benbergk's avatar
    benbergk committed
    #include <limits>
    
    jsclose's avatar
    jsclose committed
    typedef size_t Location;  // Location 0 is the null location.
    
    benbergk's avatar
    benbergk committed
    const Location MAX_Location = std::numeric_limits<unsigned>::max();
    
    vcday's avatar
    vcday committed
    public:
    	// Returns
    
    	virtual Location First ( ) = 0;
    
    vcday's avatar
    vcday committed
    	//Returns next post of a word given current location
    
    	virtual Location Next ( ) = 0;
    
    vcday's avatar
    vcday committed
    	//Calls seek onto one past the current end doc location
    	//Return first instance of word at new document
    
    	virtual Location NextDocument ( ) = 0;
    
    vcday's avatar
    vcday committed
    	//Returns first instance of word after target location
    
    	virtual Location Seek ( Location target ) = 0;
    
    vcday's avatar
    vcday committed
    	//Returns the location of the end of the document
    
    	virtual Location GetEndDocument ( ) = 0;
    
    vcday's avatar
    vcday committed
    	Location currentLocation;
    
    	ISR *DocumentEnd;
    
    vcday's avatar
    vcday committed