73 ~CPoolRecord(
void) {
if (byteData != (uint1 *)0)
delete [] byteData; }
74 uint4
getTag(
void)
const {
return tag; }
75 const string &
getToken(
void)
const {
return token; }
101 virtual CPoolRecord *createRecord(
const vector<uintb> &refs)=0;
109 virtual const CPoolRecord *getRecord(
const vector<uintb> &refs)
const=0;
119 void putRecord(
const vector<uintb> &refs,uint4 tag,
const string &tok,
Datatype *ct);
131 virtual bool empty(
void)
const=0;
132 virtual void clear(
void)=0;
139 virtual void saveXml(ostream &s)
const=0;
169 CheapSorter(
void) { a = 0; b = 0; }
170 CheapSorter(
const CheapSorter &op2) { a = op2.a; b = op2.b; }
171 CheapSorter(
const vector<uintb> &refs) { a = refs[0]; b = (refs.size() > 1) ? refs[1] : 0; }
177 bool operator<(
const CheapSorter &op2)
const {
178 if (a != op2.a)
return (a<op2.a);
185 void apply(vector<uintb> &refs)
const { refs.push_back(a); refs.push_back(b); }
187 void saveXml(ostream &s)
const;
190 map<CheapSorter,CPoolRecord> cpoolMap;
191 virtual CPoolRecord *createRecord(
const vector<uintb> &refs);
193 virtual const CPoolRecord *getRecord(
const vector<uintb> &refs)
const;
194 virtual bool empty(
void)
const {
return cpoolMap.empty(); }
195 virtual void clear(
void) { cpoolMap.clear(); }
196 virtual void saveXml(ostream &s)
const;
void saveXml(ostream &s) const
Save object to an XML stream.
Definition: cpool.cc:20
const string & getToken(void) const
Get name of method or data-type.
Definition: cpool.hh:75
bool isDestructor(void) const
Is object a destructor method.
Definition: cpool.hh:82
The base datatype class for the decompiler.
Definition: type.hh:62
virtual void clear(void)
Release any (local) resources.
Definition: cpool.hh:195
void restoreXml(const Element *el, TypeFactory &typegrp)
Restore object from XML stream.
Definition: cpool.cc:77
Pointer to object, new name in token, new data-type in type.
Definition: cpool.hh:55
Referenced method has a this pointer.
Definition: cpool.hh:58
Pointer to a field, name in token, data-type in type.
Definition: cpool.hh:52
Constant reference to string (passed back as byteData)
Definition: cpool.hh:49
uintb getValue(void) const
Get the constant value associated with this.
Definition: cpool.hh:79
An implementation of the ConstantPool interface storing records internally in RAM.
Definition: cpool.hh:155
~CPoolRecord(void)
Destructor.
Definition: cpool.hh:73
Reference to (system level) class object, token holds class name.
Definition: cpool.hh:50
int4 getByteDataLength(void) const
Number of bytes of string literal data.
Definition: cpool.hh:77
Referenced method is a destructor.
Definition: cpool.hh:60
uint4 getTag(void) const
Get the type of record.
Definition: cpool.hh:74
Referenced method is a constructor.
Definition: cpool.hh:59
Integer length, token is language specific indicator, type is integral data-type. ...
Definition: cpool.hh:53
Datatype * getType(void) const
Get the data-type associated with this.
Definition: cpool.hh:78
const uint1 * getByteData(void) const
Get pointer to string literal data.
Definition: cpool.hh:76
An interface to the pool of constant objects for byte-code languages.
Definition: cpool.hh:94
Classes for describing and printing data-types.
An XML element. A node in the DOM tree.
Definition: xml.hh:150
Constant value of data-type type, cpool operator can be eliminated.
Definition: cpool.hh:48
A description of a byte-code object referenced by a constant.
Definition: cpool.hh:44
virtual bool empty(void) const
Is the container empty of records.
Definition: cpool.hh:194
Container class for all Datatype objects in an Architecture.
Definition: type.hh:380
Boolean value, token is language specific indicator, type is boolean data-type.
Definition: cpool.hh:54
Pointer to a method, name in token, signature in type.
Definition: cpool.hh:51
bool hasThisPointer(void) const
Is object a method with a this pointer.
Definition: cpool.hh:80
CPoolRecord(void)
Construct an empty record.
Definition: cpool.hh:72
virtual ~ConstantPool()
Destructor.
Definition: cpool.hh:103
bool isConstructor(void) const
Is object a constructor method.
Definition: cpool.hh:81