Code Fragment: Locator



  class Locator {					// a locator
  private:
    LocItemPtr locItem;					// pointer to the item
  public:
    Locator(LocItemPtr ip = NULL)			// constructor
      { locItem = ip; }
    bool isNull() const 				// is locator null?
      { return locItem == NULL; }
    const Key& key() const 				// get key (read-only)
      { return locItem->key(); }
    Element& element() 					// get element
      { return locItem->element(); }
    const Element& element() const  			// get element (read-only)
      { return locItem->element(); }
    friend class SortedSeqPriorityQueueLoc<Key, Element, Comp>;
  };