YYYSCHED CONCEPTS
*****************

coopscheduler
-------------

a coopscheduler is a cooperative scheduler.
it is something like a select() wrapper if you want to think like that.
a coopscheduler is a class.

static coopscheduler *gsched;
  // this is a pointer to a coopscheduler instance. the user can set it
  // if he wants. if a program has only one instance of a coopscheduler,
  // you needn't pass its pointer each time, but can use coopscheduler::gsched instead.
  // when the destructor of a coopscheduler gets called, it sets gsched to zero
  // if it is pointing to this instance.

first lets show the ionotify class which can fire if data is ready to be read or written.
class ionotify {  // this class is INSIDE the coopscheduler class!
  ionotify (coopscheduler *const sched_); // which coopscheduler to use.

  enum watchtype_t {READ,WRITE,EXCEPTION};
    
  // setfilehandle also does setactive(true)
  void setfilehandle(const int filehandle_, const watchtype_t watchtype_);
  inline const int getfilehandle() const { return filehandle_rep; };
  inline const watchtype_t getwatchtype() const { return watchtype_rep; };

  void setactive(const bool isactive_);
  inline const bool isactive() const { return isactive_rep; };

  SigC::Signal1<void, ionotify &> fire;
};
  
now lets show the abstimer class that fires at certain points in time.
abstimer fires once, and absolutly in time.
if the absolute timepoint is already in the past, or even zero,
it will fire at once.
defaultfiretime is 0 (fire at once)
but defaultisactive==false !
class abstimer {  // this class is INSIDE the coopscheduler class!
  abstimer (coopscheduler *const sched_); // which coopscheduler to use.

  // setting the firetime also does setactive(true)
  // setactive(false) will be called right before firing.
  void setfiretime (const yyyzeit::zeit &firetime_);
  inline const yyyzeit::zeit &firetime() const { return firetime_rep; };
    
  void setactive(const bool isactive_);
  inline const bool isactive() const { return isactive_rep; };

  SigC::Signal1<void, abstimer &> fire;
};
