PipelineFX Forum
Qube! => Developer Customization => Topic started by: dh on September 26, 2008, 08:55:31 PM
-
Is there any additional C++ Samples or Documentation beyond the 'Development.pdf' and 'examples.sln'?
I'm trying to figure out how to do something with qbshove from the C++ api, and I have no idea where to begin. The documentation is pretty sparse , and the samples do not give any indication of how to do things other than submit jobs. Am I missing something?
My specific problem is with trying to make a 'qbshove' call from the C++ API. I can see that I need to pass in a QbCommand to the qbshove API call, but I have no idea how to set it up. How should I configure it to do the equivalent of running 'qbshove --user all --pending 0' from a command prompt?
-
Hi dh,
Here's sample code that will do what you describe. We're sorry about the
sparse documentation on the C++ API. There are some info in the .h files
in the "include" dir, but don't hesitate to email us for more help with the API.
-----
#include "QbApi.h"
#include <iostream>
int main()
{
QbCommand cmd;
QbJobIdList jobs;
// we want all jobs with "pending" stauts
QbFilter *statusFilter = new QbFilter("status");
statusFilter->fields().push(new QbField("pending"));
cmd.filters().push(statusFilter);
// we want to be able to operate on jobs belonging to all users
cmd.restrictions(QB_FALSE);
// now shove the jobs!
int ret = qbshove(cmd, jobs);
// print out some results
cout << "qbshove() returned [" << ret << "]\n";
if(jobs.length())
cout << jobs.range() << endl;
return 0;
}
-
Thanks! I had managed to piece together something similar via trial-and-error, but it's nice to see that I wasn't way off base. Any plans to improve/expand the C++ API documentation and/or provide more examples?
-dh
-
Hi dh,
I'm glad that the sample code had been of some help.
Yes, we do plan to provide more API doc; but it the meantime, please don't
hesitate to ask us, either on this forum or via email to support, any API-
related questions you may have.
There's also in-line documentation in the header .h files in the
"include" directory which will help you make some sense out of
the various classes/objects.
Aloha,
-shinya.