-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathddobject.h
47 lines (40 loc) · 1020 Bytes
/
ddobject.h
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
41
42
43
44
45
46
47
#pragma once
#include <string>
#include <sstream>
#include <typeinfo>
#include <list>
namespace dd {
typedef std::string string;
typedef std::stringstream stringstream;
template <typename T>
using list = std::list<T>;
/**
* Base Java object for DD.
*/
class DdObject {
#define DDOBJECT_NAME "DdObject"
public:
/**
* Dump to string.
*/
virtual string toString() const {
stringstream ss;
ss << (void*) this;
return ss.str();
}
/**
* Extensional equality
*/
virtual bool equals(const DdObject & other) const {
return this == (&other);
}
/**
* Intensional equality
*/
bool operator==(const DdObject & other) const {
return this->equals(other);
}
virtual string typeName() const { return DDOBJECT_NAME; }
static string staticTypeName() { return DDOBJECT_NAME; }
};
}