12345678910111213141516171819202122232425262728293031323334353637 |
- /**
- * experimentQueueMain.cpp
- * - compiles to bin/queue
- * - runs through a set of controls to run the orchestrator with multiple settings over time
- *
- * Stan Gurtler
- */
- #include <iostream>
- #include <fstream>
- #include <cstring>
- #include <cstdlib>
- int main(int argc, char* argv[])
- {
- const char *ORCHESTRATOR = "bin/orchestrator ";
- const int ORCHESTRATOR_LEN = strlen(ORCHESTRATOR);
- const int INPUT_BUFFER_LEN = 133;
- const int OUTPUT_BUFFER_LEN = ORCHESTRATOR_LEN + INPUT_BUFFER_LEN;
- char inputBuffer[INPUT_BUFFER_LEN], outputBuffer[OUTPUT_BUFFER_LEN];
- std::ifstream configFile("cfg/queue.cfg");
- while (!configFile.eof())
- {
- configFile.getline(inputBuffer, INPUT_BUFFER_LEN);
- if (strlen(inputBuffer) > 0)
- {
- strncpy(outputBuffer, ORCHESTRATOR, ORCHESTRATOR_LEN);
- strncpy(outputBuffer + ORCHESTRATOR_LEN, inputBuffer, INPUT_BUFFER_LEN);
- outputBuffer[OUTPUT_BUFFER_LEN] = 0;
-
- int sysOut = system(outputBuffer);
- }
- }
- return 0;
- }
|