experimentQueueMain.cpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * experimentQueueMain.cpp
  3. * - compiles to bin/queue
  4. * - runs through a set of controls to run the orchestrator with multiple settings over time
  5. *
  6. * Stan Gurtler
  7. */
  8. #include <iostream>
  9. #include <fstream>
  10. #include <cstring>
  11. #include <cstdlib>
  12. int main(int argc, char* argv[])
  13. {
  14. const char *ORCHESTRATOR = "bin/orchestrator ";
  15. const int ORCHESTRATOR_LEN = strlen(ORCHESTRATOR);
  16. const int INPUT_BUFFER_LEN = 133;
  17. const int OUTPUT_BUFFER_LEN = ORCHESTRATOR_LEN + INPUT_BUFFER_LEN;
  18. char inputBuffer[INPUT_BUFFER_LEN], outputBuffer[OUTPUT_BUFFER_LEN];
  19. std::ifstream configFile("cfg/queue.cfg");
  20. while (!configFile.eof())
  21. {
  22. configFile.getline(inputBuffer, INPUT_BUFFER_LEN);
  23. if (strlen(inputBuffer) > 0)
  24. {
  25. strncpy(outputBuffer, ORCHESTRATOR, ORCHESTRATOR_LEN);
  26. strncpy(outputBuffer + ORCHESTRATOR_LEN, inputBuffer, INPUT_BUFFER_LEN);
  27. outputBuffer[OUTPUT_BUFFER_LEN] = 0;
  28. int sysOut = system(outputBuffer);
  29. }
  30. }
  31. return 0;
  32. }