// CondorCodTable.h #ifndef dial__CondorCodTable_H_Included #define dial__CondorCodTable_H_Included // // By Nagesh Chetan // April 2004 // #include #include namespace dial { // contains the machines and their COD claims, and methods to // request and release struct structClaimDetails { std::string strMachineName; std::string strClaimStatus; }; class CondorCodTable { public: typedef std::multimap Mmap_string; private: // a multimap that stores the machines with their claim IDs Mmap_string m_MmapMachine_IDs; // file that contains the list of machines where claims need to be obtained std::string m_MachineFile; // file that will contain claim IDs obtained std::string m_ClaimIdFile; // temporary file into which the result of the condor_status -cod is written into std::string m_tmpFile; // working directory where all the files are read from/written into std::string m_WorkingDir; // temporary directory std::string m_TmpDir; public: // constructor that reads from a file acquires claims and writes to a file CondorCodTable(std::string = "Machines.dat" , std::string = "claims.id", std::string = "tmp.file"); const Mmap_string& getmapmachine_IDs() const { return m_MmapMachine_IDs; } // calls the display_table() function std::ostream& ostr(std::ostream& lhs) const; // method that retrieves a free claim (claim status = IDLE) and the machine the free claim is on std::string getfreeclaim(std::string* = 0); // updating the claim status void updateClaimState(std::string ClaimIdA, std::string Status); // request claims on free machines, funcitonality depends on service type int requestclaims(); // store ClaimID into m_MmapMachine_IDs void storeclaimID(std::string); // to suspend an application on a claim int suspendclaim(std::string); // to resume the application on a claim int resumeclaim(std::string); // destructor // releases all claims acquired ~CondorCodTable(); }; } // end of namespace dial // displays all the entries in the multimap members of the class Table std::ostream& display_table(std::ostream&, const dial::CondorCodTable&); // overloading the << operator to display the contents of the multimap std::ostream& operator<<(std::ostream&, const dial::CondorCodTable&); #endif //dial__CondorCodTable_H_Included