o) Clean up DioTypeHolder I/O to be more user-friendly
o) Make a "last in is only one sent out" buffer (or too specialised?)
o) Make copier (if not simply the default multiproducer)
o) Systematise create/destroy for pointer implementation

















#ifndef DioProducer_HH
#define DioProducer_HH

/*****************************************************************************
 DioProducer
 
 Ths supports the generic transfer of data from one object/process to
 another. In object aaa wants to transfer data to object bbb, then only
 one of them physically does the copy. Hence the transfers can be
 classified as Active->Passive or Passive->Active
 
 Active->Passive: Here, a does the copy onto a pointer (a "push") handed
 to it by bbb. The data are owned by bbb. The main code would be

    const DioProducer a;
    DioProducer b;

    b.hsup(a);

 where internally

    int hsup(const DioProducer &a) {
      ...
      return a.push(t, maxLength);
    }

 and the other routine
 
    int push(T* t, int maxLength) const {
      ...
      t[0]=x;
      ...
      return length;
    }
 
 fills the data onto the pointer and returns the length (or -1 for an
 error).
 
 Passive->Active: Here, b does the copy from a pointer (a "pull") handed
 to it. The data are owned by a. The main code would be

    const DioProducer a;
    DioProducer b;

    a.llup(b);

 where internally

    void llup(DioProducer &b) const {
      ...
      return b.pull(t, length);
    }

 and the other routine
 
    void pull(const T* t, int length) {
      ...
      x=t[0];
      ...
      return 0;
    }

 reads the data from the pointer.
 
 ***************************************************************************/

template<class T> class DioConsumer;

template<class T> class DioProducer {

public:
  virtual T llup() = 0;

  virtual bool push(DioConsumer<T> &c) {
    return c.hsup(llup());
  }

private:
};

#endif
