Barrier.h

Go to the documentation of this file.
00001 #ifndef BARRIER_H
00002 #define BARRIER_H
00003 #include <string>
00004 #include <vector>
00005 
00006 class Barrier
00007 {
00008  private:
00009   std::string name;
00010   std::vector<bool> nodes;
00011 
00012  public:
00013   static std::string currentBarrier;
00014 
00015  public:
00016   Barrier(const char *bname, int node_num);
00017   /* Wait for all acks to come in */
00018   bool CheckBarrierReached(int delay = 100);
00019   
00020   /* Client side functions */
00021   /* Acknowledge that we reached the barrier */
00022   static void SendAck(void);
00023   /* Wait for the go ahead message */
00024   static bool WaitGoAhead(int delay = 100);
00025   /* Wait for the server to send out a new barrier*/
00026   static bool WaitForBarrier(std::string bname, int delay = 100);
00027 
00028  private:
00029   /* Send go ahead message to all nodes */
00030   void sendGoAhead(void);
00031  
00032 };
00033 
00034 #endif /*BARRIER_H*/

Generated on Sun Mar 11 15:33:24 2007 for MetalWarriors by  doxygen 1.4.7