decompiler  1.0.0
Public Member Functions | Public Attributes | List of all members
ConstantPoolInternal::CheapSorter Class Reference

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 saveXml (ostream &s) const
 Serialize the reference to an XML element. More...
 
void restoreXml (const Element *el)
 Deserialize the reference from an XML element. More...
 

Public Attributes

uintb a
 The first integer in a reference.
 
uintb b
 The second integer in a reference (or zero)
 

Detailed Description

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

Member Function Documentation

void ConstantPoolInternal::CheapSorter::apply ( vector< uintb > &  refs) const
inline

Convert the reference back to a formal array of integers.

Parameters
refsis the provided container of integers

References CPoolRecord::restoreXml(), and CPoolRecord::saveXml().

Referenced by ConstantPoolInternal::restoreXml().

bool ConstantPoolInternal::CheapSorter::operator< ( const CheapSorter op2) const
inline

Lexicographic comparison.

Parameters
op2is the reference to compare with this
Returns
true if this should be ordered before the other reference

References a, and b.

void ConstantPoolInternal::CheapSorter::restoreXml ( const Element el)

Deserialize the reference from an XML element.

Restore this reference from a <ref> XML tag

Parameters
elis the XML element

References Element::getAttributeValue().

Referenced by ConstantPoolInternal::restoreXml().

void ConstantPoolInternal::CheapSorter::saveXml ( ostream &  s) const

Serialize the reference to an XML element.

The reference is output as a <ref> tag.

Parameters
sis the output stream

References a_v_u().


The documentation for this class was generated from the following files: