Re: [classad-users] ClassAd Transform?


Date: Wed, 2 Jun 2004 16:01:16 -0500 (CDT)
From: Alain Roy <roy@xxxxxxxxxxx>
Subject: Re: [classad-users] ClassAd Transform?
Matthew Farrellee wrote:
How easily would it be for me to use the new ClassAd library to take an
input ClassAd I, a "tranform" ClassAd T, and produce an output ClassAd
O? For example:
I: [A = 2; B = 3;]
T: [A = $(A); B = $(B); C = $(A) * $(B);]
O: [A = 2; B = 3; C = 6;]
Is this a job for CAFL?
There is no easy, automatic way to do this with the new ClassAd library. 
CAFL may be appropriate.

One way to do it is to set up a big ClassAd like this:

[
  input = 0;
  template = 0;
]
Then when you know the input and template, substitute them. They won't have 
$ in them, but would look something like this:

[
  input = [A = 2; B = 3;]
  template = [A = input.A; B = input.B; C = input.A * input.C;
]
Then iterate through the template (using the STL-like functions begin() and 
end() and evaluate each expression, and create a new ClassAd.

-alain

Condor Classads Info:
http://www.cs.wisc.edu/condor/classad/


[← Prev in Thread] Current Thread [Next in Thread→]