// WsClientUniqueIdGenerator.h #ifndef dial__WsClientUniqueIdGenerator_H #define dial__WsClientUniqueIdGenerator_H // Client for uniquei ID service. #include #include "dataset_id/UniqueIdGenerator.h" #include "dial_ws/DialWsClient.h" namespace dial { class WsClientUniqueIdGenerator : public UniqueIdGenerator { private: // data std::string m_context; WsClient m_ws; public: // methods // Constructor. // context is the generator context, e.g. Dataset or Job // url is the address of the server, e.g. // http://dial.myaddress:8080 // usegsi is true to use GSI authentication WsClientUniqueIdGenerator(std::string context, std::string url, bool usegsi =true); // Destructor. ~WsClientUniqueIdGenerator(); public: // non-const methods // Fetch the next ID. UniqueId next(); // Close. int close(); public: // const methods // Validity. bool is_valid() const; // Is global. bool is_global() const; // Context. std::string context() const; // Terminate service. // Don't call this! void terminate_service() const; // Output stream. std::ostream& ostr(std::ostream& str) const; }; } // end namespace dial #endif