Changeset 1437 in Sophya for trunk/ArchTOIPipe/Kernel/toi.h
- Timestamp:
- Mar 12, 2001, 7:00:28 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/Kernel/toi.h
r1365 r1437 26 26 TOI(string name); 27 27 virtual ~TOI(); 28 29 // ----- Rajouts Reza 12/3/2001 30 virtual void PrintStatus(ostream & os) const; 31 // Fin rajouts Reza 12/3/2001 ------ 28 32 29 33 #ifdef WITH_SOPHYA … … 55 59 56 60 void setName(string n) {name =n;} 57 string getName() {return name;}61 string getName() const {return name;} 58 62 59 63 protected: 60 64 TOI* errorTOI; 61 65 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 62 76 TOIProcessor* producer; 63 77 vector<TOIProcessor*> consumers; … … 86 100 void TOIInit(); 87 101 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 88 104 void lock() {pthread_mutex_lock(&mutex);} 89 105 void unlock() {pthread_mutex_unlock(&mutex);} 90 106 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 122 public: 123 inline int getCountWaitPut() const { return countwaitput; } 124 inline int getCountWaitGet() const { return countwaitget; } 125 // Fin rajouts Reza 12/3/2001 ------ 126 91 127 }; 128 129 inline ostream & operator << (ostream & os, TOI const & toi) 130 { toi.PrintStatus(os); return os; } 92 131 93 132 class TOIRegular : public TOI { … … 101 140 TOIRegularWindow(); 102 141 TOIRegularWindow(string nm); 103 ~TOIRegularWindow();142 virtual ~TOIRegularWindow(); 104 143 105 144 virtual DataStatus isDataAvailNL(int iStart, int iEnd); … … 112 151 long i0; 113 152 double defaultValue; 114 153 115 154 #ifdef WITH_SOPHYA 116 155 virtual Array doGetData(int iStart, int iEnd);
Note:
See TracChangeset
for help on using the changeset viewer.