From: Michal Voců Date: Mon, 16 Apr 2007 10:30:00 +0000 (+0000) Subject: * static methods to retrieve status and event names X-Git-Tag: glite-lb-client-interface_R_2_3_1_1~4 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=bf5aebeb3692ab2d99db088da66289879f21af14;p=jra1mw.git * static methods to retrieve status and event names --- diff --git a/org.glite.lb.client/src/Event.cpp.T b/org.glite.lb.client/src/Event.cpp.T index 0402a80..cef4016 100644 --- a/org.glite.lb.client/src/Event.cpp.T +++ b/org.glite.lb.client/src/Event.cpp.T @@ -328,6 +328,17 @@ std::vector > const & Event::getAttrs(voi } +const std::string Event::getEventName(Type type) +{ + if(type < 0 || type >= TYPE_MAX) { + STACK_ADD; + throw(Exception(EXCEPTION_MANDATORY, EINVAL, "invalid event type")); + } + + return std::string(edg_wll_EventToString(edg_wll_EventCode(type))); +} + + void Event::destroyFlesh(void *in) { diff --git a/org.glite.lb.client/src/JobStatus.cpp.T b/org.glite.lb.client/src/JobStatus.cpp.T index 62559e0..fe09bce 100644 --- a/org.glite.lb.client/src/JobStatus.cpp.T +++ b/org.glite.lb.client/src/JobStatus.cpp.T @@ -468,6 +468,19 @@ JobStatus::getAttrs(void) const return attrs; } +const std::string & +JobStatus::getStateName(Code state) +{ + if (state<0 || state>=CODE_MAX) { + STACK_ADD; + throw(Exception(EXCEPTION_MANDATORY, + EINVAL, + "status code invalid")); + } + return names[state]; +} + + void JobStatus::destroyFlesh(void *p) {