Client adaptor - list

  template<class T>
  class list_clt : public list<T> {
  public:
      list_clt(hush::container* it = 0, T* = 0) : _bdy(it) { }
  
      list_clt<T>* operator->() { return this; }
  
      void operator=(hush::container* it) { _bdy = it; }
  
      T* first() {
          CORBA::Object* x = _body()->first();
          if (x)
                  return (T*) dummy->_narrow(x);
          else return 0;
          }
  
      T* next() {
          CORBA::Object* x = _body()->next();
          if (x)
                  return (T*) dummy->_narrow(x);
          else return 0;
          }
  
  protected:
      hush::container* _bdy;
      hush::container* _body() const { return (hush::container*) _bdy; }
  private:
      static T* dummy;
  };
  
  };
  

slide: Client adaptor - list