2005-10-29 09:52:35 +00:00
|
|
|
#ifndef _EYD_BITGROUP_HH
|
|
|
|
#define _EYD_BITGROUP_HH
|
|
|
|
|
|
|
|
#include "stdio.h"
|
|
|
|
#include <string>
|
|
|
|
#include <exception>
|
|
|
|
|
|
|
|
namespace EydLib {
|
|
|
|
class eBitGroupOutOfBound : public std::exception { };
|
2005-10-29 20:17:39 +00:00
|
|
|
class eBitGroupOutOfRangeValue : public std::exception { };
|
2005-10-29 09:52:35 +00:00
|
|
|
|
|
|
|
class BitGroup {
|
|
|
|
private:
|
|
|
|
unsigned int * _bitgroup;
|
|
|
|
int _group_size;
|
|
|
|
void copy(const BitGroup &original);
|
|
|
|
|
|
|
|
public:
|
|
|
|
BitGroup();
|
|
|
|
BitGroup(int size);
|
|
|
|
BitGroup(const BitGroup &original);
|
|
|
|
~BitGroup();
|
|
|
|
|
|
|
|
void BitGroup::init(int size);
|
|
|
|
void setBitAt(int pos, bool value);
|
|
|
|
bool getBitAt(int pos);
|
|
|
|
|
|
|
|
void setValue(unsigned long value);
|
2005-10-29 20:17:39 +00:00
|
|
|
unsigned long maxValue();
|
2005-10-29 09:52:35 +00:00
|
|
|
unsigned long getValue();
|
|
|
|
|
|
|
|
int size();
|
|
|
|
|
|
|
|
std::string toString();
|
|
|
|
BitGroup operator=(BitGroup &original);
|
|
|
|
BitGroup operator=(const BitGroup &original);
|
|
|
|
bool operator==(const BitGroup &original);
|
2005-10-29 20:17:39 +00:00
|
|
|
bool operator!=(const BitGroup &original);
|
2005-10-29 09:52:35 +00:00
|
|
|
|
|
|
|
// comparer les groupes
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|