Changeset 1437 in Sophya for trunk/ArchTOIPipe/Kernel/toi.h


Ignore:
Timestamp:
Mar 12, 2001, 7:00:28 PM (25 years ago)
Author:
ansari
Message:

Protections diverses dans TOIProcessor et FITSTOIReader/Writer
Ajout d'un TOI (TOISeqBuffered) avec gestion d'un buffer entre put/get
Ajout de processeurs de test (RZTOIProc...) , programme test associe
et SMakefile (pour compil avec SOPHYA)

Reza 12/3/2001

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/Kernel/toi.h

    r1365 r1437  
    2626  TOI(string name);
    2727  virtual ~TOI();
     28
     29  //   ----- Rajouts Reza 12/3/2001
     30  virtual void PrintStatus(ostream & os) const;
     31  //  Fin rajouts Reza 12/3/2001 ------
    2832
    2933#ifdef WITH_SOPHYA
     
    5559
    5660  void setName(string n) {name =n;}
    57   string getName() {return name;}
     61  string getName() const {return name;}
    5862
    5963protected:
    6064  TOI*                  errorTOI;
    6165  pthread_mutex_t       mutex;
     66  //   ----- Rajouts Reza 12/3/2001
     67  pthread_cond_t        condv;
     68  bool                  fgwaitput;
     69  bool                  fgwaitget;
     70  bool                  fgsigput;
     71  bool                  fgsigget;
     72  int                   countwaitput;
     73  int                   countwaitget;
     74  //  Fin rajouts Reza 12/3/2001 ------
     75
    6276  TOIProcessor*         producer;
    6377  vector<TOIProcessor*> consumers;
     
    86100  void  TOIInit();
    87101
     102  // Il faut faire attention avec mutex et condv, si TOI cree sur le stack !
     103  // Il faut donc faire new TOI  -    Reza 11/3/2001
    88104  void lock() {pthread_mutex_lock(&mutex);}
    89105  void unlock() {pthread_mutex_unlock(&mutex);}
    90106
     107  //   ----- Rajouts Reza 12/3/2001
     108  void wait() {pthread_cond_wait(&condv, &mutex);}
     109  void signal() {pthread_cond_signal(&condv);}
     110  void broadcast() {pthread_cond_broadcast(&condv);}
     111  inline void waitPut()
     112    {fgwaitput=true; countwaitput++; pthread_cond_wait(&condv, &mutex);}
     113  inline void waitGet()
     114    {fgwaitget=true; countwaitget++; pthread_cond_wait(&condv, &mutex);}
     115  inline bool isPutWaiting() const { return fgwaitput; }
     116  inline bool isGetWaiting() const { return fgwaitget; }
     117  inline void signalPut() {fgsigput=true;}
     118  inline void signalGet() {fgsigget=true;}
     119  inline void cleanWaitPut() { fgsigput = fgwaitput = false; }
     120  inline void cleanWaitGet() { fgsigget = fgwaitget = false; }
     121
     122public:
     123  inline int  getCountWaitPut() const { return countwaitput; }
     124  inline int  getCountWaitGet() const { return countwaitget; }
     125  //  Fin rajouts Reza 12/3/2001 ------
     126
    91127};
     128
     129inline ostream & operator << (ostream & os, TOI const & toi)
     130{ toi.PrintStatus(os); return os; }
    92131
    93132class TOIRegular : public TOI {
     
    101140  TOIRegularWindow();
    102141  TOIRegularWindow(string nm);
    103   ~TOIRegularWindow();
     142  virtual ~TOIRegularWindow();
    104143
    105144  virtual DataStatus isDataAvailNL(int iStart, int iEnd);
     
    112151  long          i0;
    113152  double defaultValue;
    114   
     153 
    115154#ifdef WITH_SOPHYA
    116155  virtual Array         doGetData(int iStart, int iEnd);
Note: See TracChangeset for help on using the changeset viewer.