decompiler
1.0.0
|
A cheap (efficient) placeholder for a reference to a constant pool record. More...
Public Member Functions | |
CheapSorter (void) | |
Construct a zero reference. | |
CheapSorter (const CheapSorter &op2) | |
Copy constructor. | |
CheapSorter (const vector< uintb > &refs) | |
Construct from an array of integers. | |
bool | operator< (const CheapSorter &op2) const |
Lexicographic comparison. More... | |
void | apply (vector< uintb > &refs) const |
Convert the reference back to a formal array of integers. More... | |
void | encode (Encoder &encoder) const |
Encode the reference to a stream. More... | |
void | decode (Decoder &decoder) |
Decode the reference from a stream. More... | |
Public Attributes | |
uintb | a |
The first integer in a reference. | |
uintb | b |
The second integer in a reference (or zero) | |
A cheap (efficient) placeholder for a reference to a constant pool record.
A reference can be an open-ended number of (1 or more) integers. In practice, the most integers we see in a reference is two. So this is a slightly more efficient container than an open-ended vector. The field a is the first integer, the field b is the second integer, or zero if there is no second integer. The references are ordered lexicographically. The class also serves to serialize/deserialize references from XML
|
inline |
Convert the reference back to a formal array of integers.
refs | is the provided container of integers |
References ghidra::CPoolRecord::decode(), and ghidra::CPoolRecord::encode().
Referenced by ghidra::ConstantPoolInternal::decode().
void ghidra::ConstantPoolInternal::CheapSorter::decode | ( | Decoder & | decoder | ) |
Decode the reference from a stream.
Restore this reference from a <ref> element
decoder | is the stream decoder |
References ghidra::Decoder::closeElement(), ghidra::Decoder::openElement(), and ghidra::Decoder::readUnsignedInteger().
Referenced by ghidra::ConstantPoolInternal::decode().
void ghidra::ConstantPoolInternal::CheapSorter::encode | ( | Encoder & | encoder | ) | const |
Encode the reference to a stream.
The reference is encoded as a <ref> element.
encoder | is the stream encoder |
References ghidra::Encoder::closeElement(), ghidra::Encoder::openElement(), and ghidra::Encoder::writeUnsignedInteger().
|
inline |