Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

bitblock.hpp

Go to the documentation of this file.
00001 //************************************************************************************//
00002 // Module       : bitblock.hpp
00003 // Date         : 3/12/02 (DLR)
00004 // Copyright    : 2002-2006 Copyright University Corporation for Atmospheric
00005 //                Research
00006 // Description  : Encapsulates the methods and data associated with
00007 //                a bit-block data type
00008 // Derived From : none.
00009 // Modifications:
00010 //************************************************************************************//
00011 #if !defined(BITBLOCK_HPP)
00012 #define BITBLOCK_HPP
00013 #include "gtypes.h"
00014 #include <string.h>
00015 #include <iostream.h>
00016 #include "gtbuffer.hpp"
00017 
00018 
00019 class BitBlock 
00020 {
00021 public:
00022                   BitBlock(GINT  Size);
00023                  ~BitBlock();
00024                   BitBlock(const BitBlock &a);
00025 BitBlock         &operator=(const BitBlock &);
00026 GUSHORT           operator()(const GINT  bit_posn);
00027 GUSHORT           operator[](const GINT  bit_posn);
00028 friend ostream&   operator<<(ostream&, BitBlock&);
00029 
00030 void              SetBits(GINT  bit_index, const GUSHORT  yTo);
00031 //void            SetBits(const GUSHORT  yTo);
00032 GBOOL             SetBlock(GUSHORT  *new_block, GINT  num_subblocks);
00033 GBOOL             SetBlock(GUSHORT  *new_block, GINT  num_subblocks, GINT  size_subblock, GINT  desired_bitspersubblock);
00034 GBOOL             SetBlock(GBuffer<GUSHORT > *new_block, GINT  num_subblocks);
00035 GBOOL             SetBlock(GUSHORT  *hi_block, GUSHORT  *lo_block, GINT  n);
00036 GUSHORT            *GetBlock();
00037 void              *LoWord();
00038 void              *HiWord();
00039 GINT              GetBlockSize_InBits();
00040 GINT              GetBlockSize_InBlocks();
00041 void              Reset();
00042 void              TransferBits(void *in_elems, GINT  nelems, size_t elem_size);
00043 
00044 
00045 private:
00046 // Private methods:
00047 GUSHORT       getbits_(GUSHORT , int posn, int numbits);
00048 GUSHORT       setbits_(GUSHORT , int posn, int numbits, GUSHORT  y);
00049 // Private data:
00050 
00051 GUSHORT            *iBlock;
00052 GINT              BitFieldLength;
00053 GINT              nBits;   
00054 GINT              NumIntSubBlocks;
00055 
00056 };
00057 #endif
00058 

Generated on Wed Dec 21 16:00:48 2005 for Geophysics & Astrophysics Spectral Element Adaptive Refinement (GASpAR) 2D Code by  doxygen 1.4.4