Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Joseph Kogut

By: a guest on Jan 30th, 2010  |  syntax: C++  |  size: 0.82 KB  |  views: 80  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. //Part of Laverna's Brute
  2.  
  3. #ifndef DIRECTOR_H_
  4. #define DIRECTOR_H_
  5.  
  6. #include "ProcessingPath.h"
  7. #include "MasterThread.h"
  8.  
  9. class Director
  10. {
  11. public:
  12.  
  13.         Director();
  14.         Director(unsigned long long beginKeyspace, unsigned long long keyspaceEnd);
  15.  
  16.         ~Director();
  17.  
  18.         void operator()();
  19.  
  20.         static processingPath* getWorkerPtr(int id);
  21.         static void manageWorker(processingPath* worker);
  22.  
  23.         // The return value is whether or not the director was able to create new work for the idle thread
  24.         static bool reassignKeyspace(processingPath* worker);
  25.  
  26. protected:
  27.  
  28.         void updateIterations();
  29.  
  30.         static unsigned long long getRemainingKeyspace(int id);
  31.         static unsigned long long getRemainingKeyspace(processingPath* worker);
  32.  
  33.         static processingPath** workerPtrArray;
  34.  
  35.         static bool server;
  36.         static int numWorkers;
  37. };
  38.  
  39. #endif