#include <dict.h>
Inheritance diagram for PSet< T >:
Public Member Functions | |
Overrides from class PObject | |
virtual PObject * | Clone () const |
New functions for class | |
void | Include (const T *obj) |
PSet & | operator+= (const T &obj) |
void | Exclude (const T *obj) |
PSet & | operator-= (const T &obj) |
PBoolean | Contains (const T &key) const |
PBoolean | operator[] (const T &key) const |
virtual const T & | GetKeyAt (PINDEX index) const |
Protected Member Functions | |
PSet (int dummy, const PSet *c) |
By default, objects placed into the set will { not} be deleted when removed or when all references to the set are destroyed. This is different from the default on most collection classes.
Note that if templates are not used the PDECLARE_SET# macro will simulate the template instantiation.
Create a new, empty, dictionary. The parameter indicates whether to delete objects that are removed from the set.
Note that by default, objects placed into the set will { not} be deleted when removed or when all references to the set are destroyed. This is different from the default on most collection classes.
Create a new, empty, dictionary. The parameter indicates whether to delete objects that are removed from the set.
Note that by default, objects placed into the set will { not} be deleted when removed or when all references to the set are destroyed. This is different from the default on most collection classes.
Make a complete duplicate of the set. Note that all objects in the array are also cloned, so this will make a complete copy of the set.
Reimplemented from PObject.
void PSet< T >::Include | ( | const T * | obj | ) | [inline] |
Include the specified object into the set. If the objects value is already in the set then the object is { not} included. If the AllowDeleteObjects option is set then the obj# parameter is also deleted.
The object values are compared, not the pointers. So the objects in the collection must correctly implement the PObject::Compare()# function. The hash table is used to locate the entry.
Include the specified objects value into the set. If the objects value is already in the set then the object is { not} included.
The object values are compared, not the pointers. So the objects in the collection must correctly implement the PObject::Compare()# function. The hash table is used to locate the entry.
void PSet< T >::Exclude | ( | const T * | obj | ) | [inline] |
Remove the object from the set. If the AllowDeleteObjects option is set then the object is also deleted.
The object values are compared, not the pointers. So the objects in the collection must correctly implement the PObject::Compare()# function. The hash table is used to locate the entry.
Remove the objects value from the set. If the AllowDeleteObjects option is set then the object is also deleted.
The object values are compared, not the pointers. So the objects in the collection must correctly implement the PObject::Compare()# function. The hash table is used to locate the entry.
Determine if the value of the object is contained in the set. The object values are compared, not the pointers. So the objects in the collection must correctly implement the PObject::Compare()# function. The hash table is used to locate the entry.
key | Key to look for in the set. |
Determine if the value of the object is contained in the set. The object values are compared, not the pointers. So the objects in the collection must correctly implement the PObject::Compare()# function. The hash table is used to locate the entry.
key | Key to look for in the set. |
virtual const T& PSet< T >::GetKeyAt | ( | PINDEX | index | ) | const [inline, virtual] |
Get the key in the set at the ordinal index position.
The ordinal position in the set is determined by the hash values of the keys and the order of insertion.
The last key/data pair is remembered by the class so that subseqent access is very fast.
index | Index of value to get. |