PipelineFX Forum
Qube! => Developer Customization => Topic started by: methodhai on November 06, 2007, 03:11:07 AM
-
I should have combined this with the previous post - but I forgot...in the function:
QB_INT qbstdoutstream(QB_INT jobid, QB_INT subid, QB_INT pos, QbString& data);
What is the purpose of the 'pos' parameter - and what criteria should I use to determine what to pass to it?
Thanks,
Hai
-
Hey Hai,
The qbstdoutstream is actually a routine used to pull data off of the local disk. The qbstdout routine is probably better for most purposes. I suspect you picked the qbstdoutstream routine because it looks simpler to use. In replacement to that, you can do the following:
QbCommand cmd;
cmd.jobids().push(new QbJobId(jobid, subid));
QbLogList logs;
qbstdout(cmd, logs)
for (QB_INT i = 0; i < logs.length(); i++) {
QbLog* log = logs.get(i);
if (log == NULL)
continue;
cout << log->data() << endl;
}
-
Thanks for the reply Anthony.
Just one more question...the parameter for QbLogList::get is the subjob id right?
-
Actually no, the QbLogList::get(QB_INT i) parameter is based on an interator, starting at 0 and ending at QbLogList::length() - 1
As a matter of common naming withint Qube! you'll find that all objects ending with "List" are based on a list object, and all objects ending with Hash are hash objects. The "get" and "length" routines are common to both.
-
But one thing that still isn't clear to me is: what's exactly is stored in the list? Is it different line groups of the log? Or does it correspond to a frame within the sub job? Or is it just an arbitrary collection of data that comprises the log?
I assume there is some kind of correspondence to a parameter or property of some type since you're looping through it.
-
Ah I see. Each QbLog object normally corresponds to individual subjob log data. You can get which subjob the log belongs to by looking at the subid() method. There is no requirement for the supervisor to return them in order. So checking that method is recommended rather than relying on get(i) to determine the order.
-
Thanks anthony!
It's all starting to make sense now...I think.
-
Another question...hopefully one of the last...
Is there a way to get at the logs via jobid/agenda name - as opposed to jobid/subjobid?
Could I potential do something like this:
QbCommand cmd;
cmd.jobids().push(new QbJobId(jobid) );
cmd.workids().push( new QbWorkId(workid) );
?
-
Actually, you are allowed to do this:
cmd.workids().push(new QbWorkId(jobid, workname));
and the routine will return back the agenda item's log data.
the QbLog objects will be initialized with that data and the workname method also
initialized with the data you asked for.