Download Processing Graph Method Tool (PGMT) User's Manual

Transcript
token in the workspace and then uses the putToken member function to write the
token. The function putToken returns true if the token is successfully written to
the port (i. e. the token is put on the place to which the port is connected) and
false if not. Code to write data to a port could look like
datatype * in;
Boolean retVal;
in = inputdataPort -> getWorkSpace;
… code to build the token…
retVal=inputdataPort -> putToken();
Since constructing tokens from scratch is a complicated process, three special put
methods are available for writing to the graph: putLeaf for scalar, putVector for a
vector (a height 1 family), and putMatrix for a matrix of values (regular family
height 2). Examples of the code for each case (line 21 in the example code is for
the vector case), where inputdataPort has been declared as the type
GCL_GraphInport_T<datatype> and has already been attached to the command
program are
For a scalar :
bool retval;
datatype in;
in =xxxi;
retVal=inputdataPort -> putLeaf( in);
for a vector:
unsigned int i;
bool retval;
datatype in[1000];
for ( i=0; i < size; i++) in[i]==xxxi;
retVal=inputdataPort -> putVector( SIZE, in);
and for a matrix
unsigned int i,j,nrows=2--,ncols=300;