diff options
author | chatty | 1992-12-15 10:55:33 +0000 |
---|---|---|
committer | chatty | 1992-12-15 10:55:33 +0000 |
commit | 3a4838bed13b767132cbdf06364b2658da6cc356 (patch) | |
tree | f6d7b33264c4634d069409ba3169126823ac4090 /utils/BitField.h | |
parent | 23abb4b87c7e40ed259dd02f653516f60e55ade4 (diff) | |
download | ivy-league-3a4838bed13b767132cbdf06364b2658da6cc356.zip ivy-league-3a4838bed13b767132cbdf06364b2658da6cc356.tar.gz ivy-league-3a4838bed13b767132cbdf06364b2658da6cc356.tar.bz2 ivy-league-3a4838bed13b767132cbdf06364b2658da6cc356.tar.xz |
Initial revision
Diffstat (limited to 'utils/BitField.h')
-rw-r--r-- | utils/BitField.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/utils/BitField.h b/utils/BitField.h new file mode 100644 index 0000000..cc7633c --- /dev/null +++ b/utils/BitField.h @@ -0,0 +1,45 @@ +/* + * CENA C++ Utilities + * + * by Stephane Chatty + * + * Copyright 1992 + * Centre d'Etudes de la Navigation Aerienne (CENA) + * + * bit fields + * + * $Id$ + * $CurLog$ + */ + +#ifndef BitField_H_ +#define BitField_H_ + +#include "bool.h" + +class CcuBitRef { +friend class CcuBitField; + +protected: + short Chunk; + short Offset; + CcuBitField& Field; +inline CcuBitRef (CcuBitField& f, short c, short o) : Field (f), Chunk (c), Offset (o) {} + +public: + operator bool () const; + bool operator = (bool) const; +}; + +class CcuBitField { +friend class CcuBitRef; + +protected: + long Chunks [8]; +public: + CcuBitField (); + CcuBitRef operator [] (int); +}; + + +#endif /* BitField_H_ */ |