BitInfo.h

00001 # ifndef Conjecture_BitInfo_h
00002 # define Conjecture_BitInfo_h Conjecture_BitInfo_h
00003 
00004 // Insert SVN header substitution variable here
00005 // Class Champion: Unassigned
00006 
00007 // Created 2006/06/10 by wade
00008 
00009 // IMPORTANT: NO VIRTUAL METHODS!
00010 
00011 # include "BitOverlay.h"  // parent
00012 
00013 namespace Conjecture {
00014     
00039     class BitInfo : public BitOverlay {
00040       public:
00041         // Constructors/Destructors
00042         BitInfo(BitOverlay::Layout layout);
00043         
00044         // Accessors
00045         inline const BitOverlay::BitCount & largestRegion() const { return this->_largestRegion; }
00046         inline const unsigned short*        regions()       const { return this->_regions; }
00047         inline const BitOverlay::BitCount & regionCount()   const { return this->_regionCount; }
00048         inline const BitOverlay::BitPos &   firstLow()      const { return this->_firstLow; }
00049         inline const BitOverlay::BitPos &   firstHigh()     const { return this->_firstHigh; }
00050         
00051         // Input/Output
00052         std::ostream& print(std::ostream& os = std::cout, const std::string& indent = "") const;
00053         
00054         // Interface
00055         static void Test(int argc = 0, const char* argv[] = NULL);
00056         
00057       protected:
00058         // Accessors
00059         inline void            largestRegionIs(const BitOverlay::BitCount & largestRegion) { this->_largestRegion = largestRegion; }
00060         inline void            regionCountIs(const BitOverlay::BitCount & regionCount) { this->_regionCount = regionCount; }
00061         inline void            firstLowIs(const BitOverlay::BitPos & firstLow) { this->_firstLow = firstLow; }
00062         inline void            firstHighIs(const BitOverlay::BitPos & firstHigh) { this->_firstHigh = firstHigh; }
00063         
00064         // Methods 
00065         
00066       private: 
00067         // Accessors
00068         inline BitOverlay::BitCount &  largestRegionRef() { return this->_largestRegion; }
00069         inline unsigned short* regionsRef() { return this->_regions; }
00070         inline BitOverlay::BitCount &  regionCountRef() { return this->_regionCount; }
00071         inline BitOverlay::BitPos &    firstLowRef() { return this->_firstLow; }
00072         inline BitOverlay::BitPos &    firstHighRef() { return this->_firstHigh; }
00073         
00074         // Methods 
00075         
00076         // State
00077         BitOverlay::BitCount  _largestRegion;
00078 
00079         // could dynamically allocate smaller size, but this is faster.
00080         // Encodes both 'start' (least significant) and 'size' of region.
00081         // High 4-bits for start, 
00082         unsigned short        _regions[16]; 
00083         BitOverlay::BitCount  _regionCount;
00084         BitOverlay::BitPos    _firstLow;
00085         BitOverlay::BitPos    _firstHigh;
00086     };
00087 }
00088 
00089 # endif // Conjecture_BitInfo_h
00090 

Generated on Thu Jun 15 19:56:09 2006 for Conjecture by  doxygen 1.4.6