PTLib
Version 2.10.10
|
This class is used when an ordinal index value is the key for PSet
and PDictionary
classes.
More...
#include <dict.h>
Public Member Functions | |
Construction | |
PINLINE | POrdinalKey (PINDEX newKey=0) |
Create a new key for ordinal index values. More... | |
PINLINE POrdinalKey & | operator= (PINDEX) |
Operator to assign the ordinal. More... | |
Overrides from class PObject | |
virtual PObject * | Clone () const |
Create a duplicate of the POrdinalKey. More... | |
virtual Comparison | Compare (const PObject &obj) const |
Compare the two objects and return their relative rank. More... | |
virtual PINDEX | HashFunction () const |
This function calculates a hash table index value for the implementation of PSet and PDictionary classes. More... | |
virtual void | PrintOn (ostream &strm) const |
Output the ordinal index to the specified stream. More... | |
New functions for class | |
PINLINE | operator PINDEX () const |
Operator so that a POrdinalKey can be used as a PINDEX value. More... | |
PINLINE PINDEX | operator++ () |
Operator to pre-increment the ordinal. More... | |
PINLINE PINDEX | operator++ (int) |
Operator to post-increment the ordinal. More... | |
PINLINE PINDEX | operator-- () |
Operator to pre-decrement the ordinal. More... | |
PINLINE PINDEX | operator-- (int) |
Operator to post-decrement the ordinal. More... | |
PINLINE POrdinalKey & | operator+= (PINDEX) |
Operator to add the ordinal. More... | |
PINLINE POrdinalKey & | operator-= (PINDEX) |
Operator to subtract from the ordinal. More... | |
![]() | |
virtual | ~PObject () |
virtual const char * | GetClass (unsigned ancestor=0) const |
Get the current dynamic type of the object instance. More... | |
PBoolean | IsClass (const char *cls) const |
virtual PBoolean | InternalIsDescendant (const char *clsName) const |
Determine if the dynamic type of the current instance is a descendent of the specified class. More... | |
virtual Comparison | CompareObjectMemoryDirect (const PObject &obj) const |
Determine the byte wise comparison of two objects. More... | |
bool | operator== (const PObject &obj) const |
Compare the two objects. More... | |
bool | operator!= (const PObject &obj) const |
Compare the two objects. More... | |
bool | operator< (const PObject &obj) const |
Compare the two objects. More... | |
bool | operator> (const PObject &obj) const |
Compare the two objects. More... | |
bool | operator<= (const PObject &obj) const |
Compare the two objects. More... | |
bool | operator>= (const PObject &obj) const |
Compare the two objects. More... | |
virtual void | ReadFrom (istream &strm) |
Input the contents of the object from the stream. More... | |
Additional Inherited Members | |
![]() | |
enum | Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 } |
Result of the comparison operation performed by the Compare() function. More... | |
![]() | |
static const char * | Class () |
Get the name of the class as a C string. More... | |
static Comparison | InternalCompareObjectMemoryDirect (const PObject *obj1, const PObject *obj2, PINDEX size) |
Internal function caled from CompareObjectMemoryDirect() More... | |
![]() | |
PObject () | |
Constructor for PObject, made protected so cannot ever create one on its own. More... | |
This class is used when an ordinal index value is the key for PSet
and PDictionary
classes.
PINLINE POrdinalKey::POrdinalKey | ( | PINDEX | newKey = 0 | ) |
Create a new key for ordinal index values.
newKey | Ordinal index value to use as a key. |
|
virtual |
Create a duplicate of the POrdinalKey.
Reimplemented from PObject.
|
virtual |
Compare the two objects and return their relative rank.
This function is usually overridden by descendent classes to yield the ranking according to the semantics of the object.
The default function is to use the CompareObjectMemoryDirect()
function to do a byte wise memory comparison of the two objects.
LessThan
, EqualTo
or GreaterThan
according to the relative rank of the objects. Reimplemented from PObject.
|
virtual |
This function calculates a hash table index value for the implementation of PSet
and PDictionary
classes.
Reimplemented from PObject.
PINLINE POrdinalKey::operator PINDEX | ( | ) | const |
Operator so that a POrdinalKey can be used as a PINDEX value.
PINLINE PINDEX POrdinalKey::operator++ | ( | ) |
Operator to pre-increment the ordinal.
PINLINE PINDEX POrdinalKey::operator++ | ( | int | ) |
Operator to post-increment the ordinal.
PINLINE POrdinalKey& POrdinalKey::operator+= | ( | PINDEX | ) |
Operator to add the ordinal.
PINLINE PINDEX POrdinalKey::operator-- | ( | ) |
Operator to pre-decrement the ordinal.
PINLINE PINDEX POrdinalKey::operator-- | ( | int | ) |
Operator to post-decrement the ordinal.
PINLINE POrdinalKey& POrdinalKey::operator-= | ( | PINDEX | ) |
Operator to subtract from the ordinal.
PINLINE POrdinalKey& POrdinalKey::operator= | ( | PINDEX | ) |
Operator to assign the ordinal.
|
virtual |
Output the ordinal index to the specified stream.
This is identical to outputting the PINDEX, i.e. integer, value.
Reimplemented from PObject.