-
Notifications
You must be signed in to change notification settings - Fork 16
/
ID_Value.Th
40 lines (36 loc) · 934 Bytes
/
ID_Value.Th
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef ID_VALUE_H_
#define ID_VALUE_H_
#include <string>
#include "craq_rpc.h"
using namespace std;
typedef unsigned char byte;
class ID_Value
{
private:
bool null;
byte id[20];
rpc_hash test;
static int hex_to_int(char x);
public:
ID_Value();
ID_Value(byte newid[20]);
ID_Value(rpc_hash newid);
virtual ~ID_Value();
string toString() const;
void fromString(const string s);
bool isNull();
void setNull();
void randomize();
rpc_hash get_rpc_id() const;
void set_from_rpc(rpc_hash newid);
bool between(ID_Value x, ID_Value y) const;
bool betweenIncl(ID_Value x, ID_Value y) const;
bool operator == (const ID_Value &other) const;
bool operator != (const ID_Value &other) const;
bool operator < (const ID_Value &other) const;
bool operator > (const ID_Value &other) const;
bool operator <= (const ID_Value &other) const;
bool operator >= (const ID_Value &other) const;
ID_Value & operator ++ ();
};
#endif