next up previous contents
Next: The GedgePtrBagLink Class Implementation: Up: The Bag Classes: Previous: The Bag Classes:

The Edge Bag Definitions:

class Gedge;
class GedgePtrBagIter;
class GedgePtrBagManip;
class GedgePtrBagLink;

class GedgePtrBagLink{
    friend GedgePtrBagIter;
    friend GedgePtrBagManip;
  private:
    Gedge *d_pointer_p;
    GedgePtrBagLink *d_next_p;
    GedgePtrBagLink(const GedgePtrBagLink&);
    GedgePtrBagLink& operator=(const GedgePtrBagLink&);
    int operator==(const GedgePtrBagLink&);    
  public:
    GedgePtrBagLink(Gedge *pointer,GedgePtrBagLink *next);
    ~GedgePtrBagLink();
    GedgePtrBagLink *next() const;
    Gedge *pointer() const;
  };
  
class GedgePtrBag{
    friend GedgePtrBagIter;
    friend GedgePtrBagManip;
  private:
    GedgePtrBagLink *d_root_p;
    GedgePtrBag(const GedgePtrBag&);
    GedgePtrBag& operator=(const GedgePtrBag&);
  public:
    GedgePtrBag();
    ~GedgePtrBag();
    void add(Gedge *pointer);
    void removeAll(const Gedge *pointer);
  };

class GedgePtrBagIter{
    friend GedgePtrBagLink;
  private:
    GedgePtrBagLink *d_link_p;
    GedgePtrBagIter(const GedgePtrBagIter& T);
    GedgePtrBagIter& operator=(const GedgePtrBagIter&);
  public:
    GedgePtrBagIter(const GedgePtrBag& bag) : d_link_p(bag.d_root_p){};
    ~GedgePtrBagIter(){};
    void operator++();
    Gedge *operator()() const;
    operator const void *() const;
  };
  
class GedgePtrBagManip{
  private:
    GedgePtrBagLink **d_addrLink_p;
    GedgePtrBagLink *L;
    GedgePtrBagManip(const GedgePtrBagManip&);
    GedgePtrBagManip& operator=(const GedgePtrBagManip&);
  public:
    GedgePtrBagManip(GedgePtrBag* bag);
    ~GedgePtrBagManip();
    void advance();
    void remove();
    Gedge *operator()() const;
    operator const void *() const;
  };



Jim Peterson
1999-05-17