42 lines
808 B
C++
42 lines
808 B
C++
#ifndef _EYD_BITGROUP_HH
|
|
#define _EYD_BITGROUP_HH
|
|
|
|
#include "stdio.h"
|
|
#include <string>
|
|
#include <exception>
|
|
|
|
namespace EydLib {
|
|
class eBitGroupOutOfBound : public std::exception { };
|
|
|
|
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);
|
|
unsigned long getValue();
|
|
|
|
int size();
|
|
|
|
std::string toString();
|
|
BitGroup operator=(BitGroup &original);
|
|
BitGroup operator=(const BitGroup &original);
|
|
bool operator==(const BitGroup &original);
|
|
|
|
// comparer les groupes
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|