Author Topic: How do I submit a job with a detailed agenda in C++?  (Read 10432 times)

methodhai

  • Sr. Member
  • ****
  • Posts: 28
How do I submit a job with a detailed agenda in C++?
« on: December 06, 2007, 02:09:58 AM »
So I think this is the final phase of our customization process....hopefully :)

I looked at the sample code, but there doesn't seem to be an example of how to submit a job with detailed information, such as ranges, padding etc. I thought I could just fill out the fields and call qbsubmit, but it doesn't seem to work. Could you kindly provide me with an example in C++?

Thanks,
Hai

anthony

  • Senior Software Engineer
  • Hero Member
  • *****
  • Posts: 183
Re: How do I submit a job with a detailed agenda in C++?
« Reply #1 on: December 12, 2007, 10:15:05 PM »
Essentially, the agenda to the supervisor, is just a list of items.  We actually extend that concept furthur at the client end.  So responsibility of breaking up frame ranges as well as interpriting them is placed on the backend and the frontend.

To submit a frame range, individual, just do the following:

QbJob* job = new QbJob();
job->prototype("cmdrange");

qb_package* pkg = qb_package_new();
   qb_package* cmdline = qb_package_new();
   qb_package_set_name(cmdline, "cmdline");
   qb_package_set_value(cmdline, "ls -la"); // set command line
qb_package_list_push(pkg, cmdline);

   qb_package* cmdpadding = qb_package_new();
   qb_package_set_name(cmdpadding, "padding");
   qb_package_set_value(cmdpadding, "4"); // set padding value
qb_package_list_push(pkg, cmdpadding);

QbString pack;
pack = qb_package_compact(pkg);
job->data(pack);
qb_package_destroy(pkg);


QbRange range("1-100");
for (QB_INT i = 0; i < range.length(); i++) {
     QbWork* work = new QbWork();
     work->name(range.get(i));
     job->agenda().push(work);
}

QbJobList jobs;
QbJobList result;

jobs.push(job);

qbsubmit(jobs, result);