/** Symbolic names for types of attribute values. */
enum AttrType { INT_T, /**< Integer value. */
+ FLOAT_T, /**< Float value. */
+ DOUBLE_T, /**< Double value. */
STRING_T, /**< String value. */
TIMEVAL_T, /**< Time value (ie. struct
timeval). */
*/
int getValInt(Attr name) const;
+ /** Retrieve float attribute.
+ *
+ * Retrieves value for attributes of float type.
+ * \param[in] name Name of the attribute to retrieve.
+ * \returns Integer value of the attribute.
+ * \throw Exception Invalid event type or attribute not
+ * defined for this event.
+ */
+ float getValFloat(Attr name) const;
+
+ /** Retrieve double attribute.
+ *
+ * Retrieves value for attributes of double type.
+ * \param[in] name Name of the attribute to retrieve.
+ * \returns Integer value of the attribute.
+ * \throw Exception Invalid event type or attribute not
+ * defined for this event.
+ */
+ double getValDouble(Attr name) const;
+
/** Retrieve string attribute.
*
* Retrieves value for attributes of string type.
# $Id$
# $Name$
-module.version=2.3.1
-module.age=2
+module.version=2.3.2
+module.age=1
-#Fri Sep 02 14:17:41 CEST 2005
-# glite-lb-client_branch_3_0_0_RC15 tag is taken!
-module.version=2.3.2
+# $Id$
+# $Name$
+module.version=2.3.3
module.age=1
return -1; /* gcc, shut up! */
}
+float Event::getValFloat(Attr attr) const
+{
+ edg_wll_Event const *cev = (edg_wll_Event *) flesh->ptr;
+
+@@@{
+ $indent = "\t";
+ typeswitch '_common_',undef,'float';
+@@@}
+
+ switch (cev->type) {
+@@@{
+ $indent = "\t\t";
+ for my $t (getTypes $event) {
+ gen "\t\tcase ".uc($t).":\n";
+ typeswitch $t,'goto badattr;','float';
+ }
+@@@}
+ default:
+ STACK_ADD;
+ throw(Exception(EXCEPTION_MANDATORY, EINVAL,
+ "attribute is not of float type"));
+ }
+badattr:
+ STACK_ADD;
+ throw(Exception(EXCEPTION_MANDATORY, ENOENT, "invalid attribute"));
+ return -1; /* gcc, shut up! */
+}
+
+double Event::getValDouble(Attr attr) const
+{
+ edg_wll_Event const *cev = (edg_wll_Event *) flesh->ptr;
+
+@@@{
+ $indent = "\t";
+ typeswitch '_common_',undef,'double';
+@@@}
+
+ switch (cev->type) {
+@@@{
+ $indent = "\t\t";
+ for my $t (getTypes $event) {
+ gen "\t\tcase ".uc($t).":\n";
+ typeswitch $t,'goto badattr;','double';
+ }
+@@@}
+ default:
+ STACK_ADD;
+ throw(Exception(EXCEPTION_MANDATORY, EINVAL,
+ "attribute is not of double type"));
+ }
+badattr:
+ STACK_ADD;
+ throw(Exception(EXCEPTION_MANDATORY, ENOENT, "invalid attribute"));
+ return -1; /* gcc, shut up! */
+}
+
static char const *get_string_val(const edg_wll_Event *cev, Event::Attr attr)
{
@@@{
return rs;
}
+static void read_float(const edg_wll_Args* o, char* arg, char* par)
+{
+ float d;
+ if (!par)
+ {
+ printf("Option: %s - missing float value\n", arg);
+ exit(1);
+ }
+ d = strtof(par,NULL);
+ if (o->min != o->max)
+ {
+ if (d < o->min && d > o->max)
+ {
+ printf("Option: %s - value: %f out of range <%d, %d>",
+ arg, d, o->min, o->max);
+ exit(1);
+ }
+ }
+ if (o->value)
+ *(float*)o->value = d;
+}
+
static void read_double(const edg_wll_Args* o, char* arg, char* par)
{
double d;
if (!par)
{
- printf("Option: %s - missing double/float value\n", arg);
+ printf("Option: %s - missing double value\n", arg);
exit(1);
}
- d = atof(par);
+ d = strtod(par,NULL);
if (o->min != o->max)
{
if (d < o->min && d > o->max)
case Args::Option::BOOL:
read_bool(&o[j], arr[i], par, r);
break;
+ case Args::Option::FLOAT:
+ read_float(&o[j], arr[i], par, r);
+ break;
case Args::Option::DOUBLE:
read_double(&o[j], arr[i], par, r);
break;
if (!read_bool(o, arg, par))
ctx->idx--; // no argument given
break;
+ case EDG_WLL_ARGS_FLOAT:
+ read_float(o, arg, par);
+ break;
case EDG_WLL_ARGS_DOUBLE:
read_double(o, arg, par);
break;
EDG_WLL_ARGS_BOOL,
EDG_WLL_ARGS_INT,
EDG_WLL_ARGS_UINT16,
+ EDG_WLL_ARGS_FLOAT,
EDG_WLL_ARGS_DOUBLE,
EDG_WLL_ARGS_STRING,
EDG_WLL_ARGS_HELP,
my %typetab = (
"char *", "EDG_WLL_ARGS_STRING",
"int", "EDG_WLL_ARGS_INT",
+ "double", "EDG_WLL_ARGS_DOUBLE",
"edg_wlc_JobId", "EDG_WLL_ARGS_JOBID",
"edg_wll_NotifId", "EDG_WLL_ARGS_NOTIFID",
"edg_wll_Source", "EDG_WLL_ARGS_SOURCE",
void edg_wll_add_tagged_string_to_XMLBody(char **body, const char *toAdd, const char *tag, const char *name, const char *tag2, const char *null);
void edg_wll_add_int_to_XMLBody(char **body, const int toAdd, const char *tag, const int null);
void edg_wll_add_float_to_XMLBody(char **body, const float toAdd, const char *tag, const float null);
+void edg_wll_add_double_to_XMLBody(char **body, const double toAdd, const char *tag, const double null);
void edg_wll_add_timeval_to_XMLBody(char **body, struct timeval toAdd, const char *tag, const struct timeval null);
void edg_wll_add_jobid_to_XMLBody(char **body, edg_wlc_JobId toAdd, const char *tag, const void *null);
void edg_wll_add_notifid_to_XMLBody(char **body, edg_wll_NotifId toAdd, const char *tag, const void *null);
edg_wll_JobStatCode edg_wll_from_string_to_edg_wll_JobStatCode(edg_wll_XML_ctx *XMLCtx);
int edg_wll_from_string_to_int(edg_wll_XML_ctx *XMLCtx);
float edg_wll_from_string_to_float(edg_wll_XML_ctx *XMLCtx);
+double edg_wll_from_string_to_double(edg_wll_XML_ctx *XMLCtx);
long edg_wll_from_string_to_long(edg_wll_XML_ctx *XMLCtx);
uint16_t edg_wll_from_string_to_uint16_t(edg_wll_XML_ctx *XMLCtx);
struct timeval edg_wll_from_string_to_timeval(edg_wll_XML_ctx *XMLCtx);
-#Fri Sep 02 14:17:07 CEST 2005
-module.version=5.0.1
+# $Id$
+# $Name$
+module.version=5.0.2
module.age=1
}
}
+void edg_wll_add_double_to_XMLBody(char **body, const double toAdd, const char *tag, const double null)
+{
+ if (toAdd != null) {
+ char *newBody;
+
+ trio_asprintf(&newBody,"%s\t\t\t<%s>%|Xf</%s>\r\n", *body, tag, toAdd, tag);
+
+ free(*body);
+ *body = newBody;
+ }
+}
/* edg_wll_add_timeval_to_XMLBody(&body, eventsOut[i].any.tv, "timestamp", -1) */
return(out);
}
+double edg_wll_from_string_to_double(edg_wll_XML_ctx *XMLCtx)
+{
+ double out = -1;
+ char *s;
+
+ s = edg_wll_UnescapeXML((const char *) XMLCtx->char_buf);
+ if (s) {
+ out = strtod(s, (char **) NULL);
+ free(s);
+ }
+ edg_wll_freeBuf(XMLCtx);
+
+ return(out);
+}
long edg_wll_from_string_to_long(edg_wll_XML_ctx *XMLCtx)
-#Fri Sep 02 14:18:35 CEST 2005
-module.version=1.5.4
+# $Id$
+# $Name$
+module.version=1.5.5
module.age=1
} else {
gen $indent."$dest = $source;\n";
}
- }
- elsif ($tn eq 'port' || $tn eq 'bool') {
+ } elsif ($tn eq 'port' || $tn eq 'bool' || $tn eq 'float' || $tn eq 'double') {
if ($f->{optional}) {
gen $indent."$dest = soap_malloc(soap, sizeof(*$dest));\n";
gen $indent."*$dest = $source;\n";
};
$dest = "VALUEEV_GET($dst, $soap_en)->$soap_fn";
- if ($tn eq 'int' || $tn eq 'port' || $tn eq 'bool' || $tn eq 'logsrc') {
+ if ($tn eq 'int' || $tn eq 'port' || $tn eq 'bool' || $tn eq 'float' || $tn eq 'double' || $tn eq 'logsrc') {
if ($f->{optional}) {
gen $indent."if ($dest) soap_dealloc(soap, $dest);\n";
}
}
elsif ($f->{optional}) {
gen "\t\t\tout->$act.$fn = *$src;\n";
+ } else {
+ gen "\t\t\tout->$act.$fn = $src;\n";
}
- else {
+ } elsif ($tn eq 'port' || $tn eq 'bool' || $tn eq 'float' || $ft eq 'double') {
+ if ($f->{optional}) {
+ gen "\t\t\tout->$act.$fn = *$src;\n";
+ } else {
gen "\t\t\tout->$act.$fn = $src;\n";
}
- }
- elsif ($ft eq 'logsrc') {
+ } elsif ($ft eq 'logsrc') {
gen "\t\t\tedg_wll_SoapToSource($src, &(out->$act.$fn));\n";
- }
- else {
+ } else {
gen "\t\t\tout->$act.$fn = $src;\n";
}
}
@type ResourceUsage Resource (CPU, memory etc.) consumption.
string resource Resource's name.
- int quantity Resources's quantity (how much).
+ double quantity Resources's quantity (how much).
string unit Units (sec, kB, etc.).
@type ReallyRunning User payload started.
_code_ REQUESTED Requested value
_code_ USED Consumed quantity
string name Name of resource
- int quantity The quantity
+ double quantity The quantity
_optional_ Bypass need of 'null value'
string unit Units (sec, kB, etc.)
@type PBSError Any error occured
string error_desc Error reason
-@type CondorSubmit Job SUBMITed to Condor
- string universe Condor Universe
- string submit_host Submitting machine
- string condor_id Condor ID
-
-@type CondorMatch Job MATCHed
- string condor_id Condor ID
+@type CondorMatch Job MATCHed
string owner Owner
string matched_host Matched host
string preempting Preempting
_optional_
+@type CondorReject Job REJECTed
+ string owner Owner
+ int status_code Reason code for the rejection of the job
+ _code_ NOMATCH No match found
+ _code_ OTHER Other reason
+
@type CondorRun Condor EXECUTEed
string condor_id Condor ID
string universe Condor Universe
logsrc=>'"edg_wll_Source"',
port=>'"uint16_t"',
# level=>'"enum edg_wll_Level"',
- int=>'"int"'
+ int=>'"int"',
+ float=>'"float"',
+ double=>'"double"',
},
'C++'=>{
string=>'"std::string"',
stslist=>'"std::vector<JobStatus>"',
logsrc=>'"int"',
port=>'"int"',
- int=>'"int"'
+ int=>'"int"',
+ float=>'"float"',
+ double=>'"double"',
},
'wsdl'=>{
bool=>'"xsd:boolean"',
logsrc=>'"eventSource"',
notifid=>'"xsd:string"',
port=>'"xsd:int"',
+ float=>'"xsd:float"',
+ double=>'"xsd:double"',
}
);
%baseTypes = (
intlist=>'int',
+ floatlist=>'float',
+ doublelist=>'double',
strlist=>'string',
stslist=>'jobstat',
taglist=>'usertag'
%toString = (
C=>{
int=>'qq{asprintf(&$dst,"%d",$src);}',
+ float=>'qq{asprintf(&$dst,"%f",$src);}',
+ double=>'qq{asprintf(&$dst,"%f",$src);}',
port=>'qq{asprintf(&$dst,"%d",(int) $src);}',
bool=>'qq{asprintf(&$dst,"%d",$src);}',
string=>'qq{$dst = $src?strdup($src):NULL;}',
%fromString = (
C=>{
int=>'qq{$dst = atoi($src);}',
+ float=>'qq{$dst = strtof($src,NULL);}',
+ double=>'qq{$dst = strtod($src,NULL);}',
port=>'qq{$dst = (uint16_t) atoi($src);}',
bool=>'qq{$dst = atoi($src);}',
string=>'qq{$dst = strdup($src);}',
%DefaultNullValue = (
int=>0,
+ float=>0.0,
+ double=>0.0,
port=>0,
# level=>'EDG_WLL_LEVEL_UNDEFINED',
bool=>0,
%compare = (
C=>{
int=>'"($a == $b)"',
+ float=>'"($a == $b)"',
+ double=>'"($a == $b)"',
port=>'"($a == $b)"',
# level=>'"($a == $b)"',
bool=>'"(($a || !$b) && ($b || !$a))"',
%toFormatString = (
C=>{
int=>'"%d"',
+ float=>'"%f"',
+ double=>'"%f"',
port=>'"%d"',
bool=>'"%d"',
# level=>'"%s"',
-#Fri Sep 02 14:19:10 CEST 2005
-module.version=1.4.3
+# $Id$
+# $Name$
+module.version=1.4.4
module.age=1