From: Michal Voců Date: Tue, 28 Aug 2007 12:14:15 +0000 (+0000) Subject: forgotten modifications X-Git-Tag: glite-yaim-myproxy_R_4_0_1_1~29 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=5344a98e97f91728d55e5c30e79ee763ea1007c0;p=jra1mw.git forgotten modifications --- diff --git a/org.glite.jobid.api-cpp/interface/JobId.h b/org.glite.jobid.api-cpp/interface/JobId.h index b84590a..262e0b8 100755 --- a/org.glite.jobid.api-cpp/interface/JobId.h +++ b/org.glite.jobid.api-cpp/interface/JobId.h @@ -3,6 +3,7 @@ #include #include +#include #include "glite/jobid/cjobid.h" @@ -36,10 +37,7 @@ private: * \param[in] exception Error message describing the exception. */ std::string formatMessage(std::string const& exception) { - std::ostringstream o; - - o << "JobId: bad argument ( " << exception << ")"; - return o.str(); + return std::string("JobId: bad argument ( ") + exception + ")"; } }; @@ -54,13 +52,6 @@ public: //@name Constructors/Destructor //@{ - /** - * Default constructor; creates a jobid of the form - * https://localhost:/ - * useful for internal processing. - */ - JobId(); - /** * Constructor from string format. * @param job_id_string @@ -167,9 +158,10 @@ JobId::JobId(std::string const& job_id_string) throw JobIdError(job_id_string); case ENOMEM: - throw std::bad_alloc; + throw std::bad_alloc(); default: + break; } } @@ -181,17 +173,18 @@ JobId::JobId(std::string const& host, int port, std::string const& unique) throw JobIdError("negative port"); } - int ret = glite_jobid_create(host.c_str(), port, - unique.empty() ? NULL : unique.c_str(), - &m_jobid); + int ret = glite_jobid_recreate(host.c_str(), port, + unique.empty() ? NULL : unique.c_str(), + &m_jobid); switch(ret) { case EINVAL: - throw JobIdError(host); - + throw JobIdError(host); + case ENOMEM: - throw std::bad_alloc; + throw std::bad_alloc(); default: + break; } } @@ -208,7 +201,7 @@ JobId::JobId(JobId const& src) int ret = glite_jobid_dup(src.m_jobid, &m_jobid); if(ret) { - throw std::bad_alloc; + throw std::bad_alloc(); } } @@ -223,7 +216,7 @@ JobId::JobId(glite_jobid_const_t src) int ret = glite_jobid_dup(src, &m_jobid); if(ret) { - throw std::bad_alloc; + throw std::bad_alloc(); } } @@ -240,7 +233,7 @@ JobId::operator=(JobId const& src) int ret = glite_jobid_dup(src.m_jobid, &m_jobid); if(ret) { - throw std::bad_alloc; + throw std::bad_alloc(); } return *this; } @@ -298,7 +291,7 @@ JobId::port() const char *name; unsigned int port; - glite_jobid_getServerParts_internal(m_jobid. + glite_jobid_getServerParts_internal(m_jobid, &name, &port); return port; } @@ -311,7 +304,6 @@ JobId::unique() const char *unique = glite_jobid_getUnique_internal(m_jobid); std::string res(unique); - free(unique); return res; }