roller.h

Go to the documentation of this file.
00001 #ifndef ROLLER_CLASS
00002 #define ROLLER_CLASS
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : roller                                                            *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 1996-$now By Author.  This program is free software; you can  *
00011 * redistribute it and/or modify it under the terms of the GNU General Public  *
00012 * License as published by the Free Software Foundation; either version 2 of   *
00013 * the License or (at your option) any later version.  This is online at:      *
00014 *     http://www.fsf.org/copyleft/gpl.html                                    *
00015 * Please send any updates to: fred@gruntose.com                               *
00016 \*****************************************************************************/
00017 
00018 #include <basis/definitions.h>
00019 
00021 
00032 template <class contents>
00033 class roller
00034 {
00035 public:
00036   roller(contents start_of_range, contents end_of_range);
00038 
00044   ~roller();
00045 
00046   // these report the constructor parameters.
00047   contents minimum() { return _start_of_range; }
00049   contents maximum() { return _end_of_range; }
00051 
00052   contents next_id();
00054 
00055   contents current() const;
00057 
00062   void set_current(contents new_current);
00064 
00066 private:
00067   contents _current_id;  
00068   contents _start_of_range;  
00069   contents _end_of_range;  
00070 };
00071 
00073 
00075 
00076 class int_roller : public roller<int>
00077 {
00078 public:
00079   int_roller(int start_of_range, int end_of_range)
00080           : roller<int>(start_of_range, end_of_range) {}
00081 };
00082 
00083 #endif
00084 

Generated on Fri Nov 21 04:29:50 2008 for HOOPLE Libraries by  doxygen 1.5.1