X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=manager%2Fprogram.h;h=b01ce00da8c7cbe5a4de12a44ab6aa19d24ada5f;hb=HEAD;hp=406d954601a8eadab01a8e3fedbb3f18a5915d47;hpb=f91a915d6f64f9d35e867d26e8ddb9c1b1ab0c1e;p=progcomp2012.git diff --git a/manager/program.h b/manager/program.h deleted file mode 100644 index 406d954..0000000 --- a/manager/program.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef PROGRAM_H -#define PROGRAM_H - -#include "thread_util.h" - -#include - -/** - * A wrapping class for an external program, which can exchange messages with the current process through stdin/stdout - * Useful for attaching control of an operation to an external process - for example, AI for a game - */ -class Program -{ - public: - Program(const char * executeablePath); //Constructor - virtual ~Program(); //Destructor - - - - - bool SendMessage(const char * print, ...); //Sends a formated message (NOTE: Prints a newline) - bool SendMessage(const std::string & buffer) {return SendMessage(buffer.c_str());} //Sends a C++ string message - bool GetMessage(std::string & buffer, double timeout=-1); //Retrieves a message, or waits for a timeout (if positive) - - bool Running() const; - - protected: - FILE * input; //Stream used for sending information TO the process - FILE * output; //Stream used for retrieving information FROM the process - - private: - pid_t pid; //Process ID of the program wrapped -}; - -#endif //PROGRAM_H - -