span_manager.h

Go to the documentation of this file.
00001 #ifndef SPAN_MANAGER_CLASS
00002 #define SPAN_MANAGER_CLASS
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : span_manager                                                      *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 1990-$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 "data_structure_dll.h"
00019 
00020 // forward:
00021 class bit_vector;
00022 
00024 
00032 class DATA_STRUCTURE_CLASS_STYLE span_manager
00033 {
00034 public:
00035   span_manager(int number_of_items);
00036     // keeps track of "number_of_items" worth of whatever the unit is.
00037 
00038   span_manager(const span_manager &to_copy);
00039 
00040   ~span_manager();
00041 
00042   span_manager &operator =(const span_manager &to_copy);
00043 
00044   void reset(int number_of_items);
00046 
00047   bool update(const int_array &new_spans);
00049 
00052   int received_sequence() const;
00054 
00057   int missing_sequence() const;
00059 
00061   void make_received_list(int_array &spans, int max_spans = -1) const;
00063 
00069   void make_missing_list(int_array &spans, int max_spans = -1) const;
00071 
00072   const bit_vector &vector() const;
00074   bit_vector &vector();
00076 
00077   istring print_received_list() const;
00079 
00080   istring print_missing_list() const;
00082 
00083 private:
00084   bit_vector *_implementation;  
00085 
00086   istring funky_print(const int_array &to_spew, int rec_seq) const;
00088 };
00089 
00090 #endif
00091 

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