sipxportlib  Version 3.3
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
DbEntry Class Reference

#include <OsConfigDb.h>

Inheritance diagram for DbEntry:
Inheritance graph
[legend]
Collaboration diagram for DbEntry:
Collaboration graph
[legend]

Public Member Functions

 DbEntry (const UtlString &key)
 
 DbEntry (const UtlString &key, const UtlString &value)
 
 ~DbEntry ()
 
virtual UtlContainableType getContainableType () const
 
virtual unsigned int hash () const
 Calculate a hash code for this object. More...
 
int compareTo (const UtlContainable *b) const
 Compare this object to another object. More...
 
- Public Member Functions inherited from UtlContainable
virtual ~UtlContainable ()
 
unsigned directHash () const
 Provides a hash function that uses the object pointer as the hash value. More...
 
virtual UtlBoolean isEqual (UtlContainable const *) const
 Test this object to another object for equality. More...
 
virtual UtlBoolean isInstanceOf (const UtlContainableType type) const
 Determine if this object is a derivative of the specified UtlContainableType. More...
 

Public Attributes

UtlString key
 
UtlString value
 

Static Public Attributes

static const UtlContainableType TYPE = "DbEntry"
 
- Static Public Attributes inherited from UtlContainable
static const UtlContainableType TYPE = "UtlContainable"
 

Additional Inherited Members

- Static Public Member Functions inherited from UtlContainable
static unsigned stringHash (char const *value)
 Provides a hash function appropriate for null-terminated string values. More...
 
static UtlBoolean areSameTypes (const UtlContainableType type1, const UtlContainableType type2)
 Are UtlContainable types the same. More...
 

Detailed Description

Class for holding a name/value pair.

Constructor & Destructor Documentation

DbEntry ( const UtlString key)
DbEntry ( const UtlString key,
const UtlString value 
)
~DbEntry ( )

Member Function Documentation

const UtlContainableType getContainableType ( ) const
virtual

Get the ContainableType for a UtlContainable-derived class.

Implements UtlContainable.

unsigned int hash ( ) const
virtual

Calculate a hash code for this object.

The hash method should return a value that is a function of the key used to locate the object. As much as possible, hash values should be uniformly distributed over the range of legal unsigned values.

Requirements
if A.isEqual(B) then A.hash() must == B.hash()

Implements UtlContainable.

int compareTo ( const UtlContainable ) const
virtual

Compare this object to another object.

Results of comparison to an object not of the same UtlContainableType may be undefined.

Returns
0 if equal, < 0 if less then and >0 if greater.
Requirements
  • if A.compareTo(B) == 0 then B.compareTo(A) must be == 0
  • if A.compareTo(B) < 0 then B.compareTo(A) must be > 0
  • if A.compareTo(B) > 0 then B.compareTo(A) must be < 0
  • if A.compareTo(B) < 0 and B.compareTo(C) < 0 then A.compareTo(C) must be < 0 etc.

Results for comparing with a non-like object are undefined, other than that it must return non-equal. Note that a copy of an object might not compare equal to the original, unless the definition of its type requires it.

Implements UtlContainable.

Member Data Documentation

const UtlContainableType TYPE = "DbEntry"
static
UtlString key
UtlString value