Changes between Initial Version and Version 1 of Ticket #88


Ignore:
Timestamp:
Feb 13, 2014, 2:08:16 PM (11 years ago)
Author:
landmark
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #88 – Description

    initial v1  
    22
    331. To set or get the value of a parameter, the programmer needs to know that Zoo internally attaches a map struct with the name "value" to the maps struct representing the parameter, e.g.
    4 
     4{{{
    55map* tmp = getMapFromMaps( inputs, "Parameter", "value" );
    6 
    76char* value = tmp->value;
    8 
     7}}}
    98(The map struct named "value" should not be confused with the value field in the map struct.)
    109
    11102. For output data with binary content types, the programmer must know that Zoo attempts to determine the size of the data buffer from a map struct with the name "size", e.g.
    12 
     11{{{
    1312int result[4] = { 0, 1, 2, 3 };
    14 
    1513char size[16];
    16 
    1714snprintf( size, sizeof( size ), "%d", sizeof( output ) );
    18 
    1915setMapInMaps( outputs, "Result", "size", size );
    20 
    2116setMapInMaps( outputs, "Result", "value", (char *) result );
    22 
     17}}}
    2318If the "size" map is missing, Zoo assumes the data is in a text-based format and calls strlen (i.e. searches the for the first 0-byte in the buffer).
    2419
    25203. To update the progress status of a process, the programmer must know that the Zoo kernel refers to a map named "status" and a map named "message" in a maps struct named "lenv" in the configuration maps struct, e.g.
    26 
     21{{{
    2722char message[] = "Progress: 99 %";
    28 
    2923char status[] = "99";
    30 
    3124setMapInMaps( conf, "lenv", "status", status );
    32 
    3325setMapInMaps( conf, "lenv", "message", message);
    34 
    3526updateStatus( conf );
    36 
     27}}}
    3728It should be possible to create a new interface that hides the Zoo kernel internal representations from the service implementation. For example, the above code fragments could perhaps be encapsulated in functions with signatures like
    38 
     29{{{
    3930char* getInputValue( maps* inputs, const char* parameterName, size_t* numberOfBytes, int* errorCode );
    40 
    4131int  setOutputValue( maps* outputs, const char* parameterName, char* data, size_t numberOfBytes ); /* return error code */
    42 
    4332int updateStatus( maps* config, int percentCompleted, const char* message ); /* return error code */
    44 
     33}}}

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png