From 3a4838bed13b767132cbdf06364b2658da6cc356 Mon Sep 17 00:00:00 2001 From: chatty Date: Tue, 15 Dec 1992 10:55:33 +0000 Subject: Initial revision --- utils/BitField.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 utils/BitField.h (limited to 'utils/BitField.h') 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_ */ -- cgit v1.1