X-Git-Url: https://git.ucc.asn.au/?p=progcomp2012.git;a=blobdiff_plain;f=progcomp%2Fjudge%2Fmanager%2Fprogram.h;fp=progcomp%2Fjudge%2Fmanager%2Fprogram.h;h=0000000000000000000000000000000000000000;hp=01e00bce1ba01f428e9f8dc78c0b133664948f67;hb=1a03b2543b67f0551e62babec4cd119f1e0e4640;hpb=e8a611c553bd336550c50ed7491d5800a2ae7142 diff --git a/progcomp/judge/manager/program.h b/progcomp/judge/manager/program.h deleted file mode 100644 index 01e00bc..0000000 --- a/progcomp/judge/manager/program.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef PROGRAM_H -#define PROGRAM_H - -#include "thread_util.h" - -#include -#include //Needed to check permissions - -/** - * 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 - -