isc::dns::NameComparisonResult Class Reference

This is a supplemental class used only as a return value of Name::compare(). More...

List of all members.

Public Types

enum  NameRelation { SUPERDOMAIN = 0, SUBDOMAIN = 1, EQUAL = 2, COMMONANCESTOR = 3 }
 

The relation of two names under comparison.

More...

Public Member Functions

Constructors and Destructor



 NameComparisonResult (int order, unsigned int nlabels, NameRelation relation)
 Constructor from a comparison tuple.
Getter Methods



int getOrder () const
 Returns the ordering of the comparison result.
unsigned int getCommonLabels () const
 Returns the number of common labels of the comparison result.
NameRelation getRelation () const
 Returns the NameRelation of the comparison result.

Detailed Description

This is a supplemental class used only as a return value of Name::compare().

It encapsulate a tuple of the comparison: ordering, number of common labels, and relationship as follows:


Member Enumeration Documentation

The relation of two names under comparison.

Its semantics for the case of name1->compare(name2) (where name1 and name2 are instances of the Name class) is as follows:

  • SUPERDOMAIN: name1 properly contains name2; name2 is a proper subdomain of name1
  • SUBDOMAIN: name1 is a proper subdomain of name2
  • EQUAL: name1 and name2 are equal
  • COMMONANCESTOR: name1 and name2 share a common ancestor

Note that in our implementation there's always a hierarchical relationship between any two names since all names are absolute and they at least share the trailing empty label. So, for example, the relationship between "com." and "net." is "commonancestor", even though it may be counter intuitive.

Enumerator:
SUPERDOMAIN 
SUBDOMAIN 
EQUAL 
COMMONANCESTOR 

Constructor & Destructor Documentation

isc::dns::NameComparisonResult::NameComparisonResult ( int  order,
unsigned int  nlabels,
NameRelation  relation 
) [explicit]

Constructor from a comparison tuple.

This constructor simply initializes the object in the straightforward way.


Member Function Documentation

unsigned int isc::dns::NameComparisonResult::getCommonLabels (  )  const

Returns the number of common labels of the comparison result.

int isc::dns::NameComparisonResult::getOrder (  )  const

Returns the ordering of the comparison result.

NameRelation isc::dns::NameComparisonResult::getRelation (  )  const

Returns the NameRelation of the comparison result.


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

Generated on Fri Dec 18 20:59:07 2009 for BIND by  doxygen 1.6.1