Ignore:
Timestamp:
Feb 25, 2019, 1:57:11 PM (5 years ago)
Author:
knut
Message:

Added some recent changes from trunk (r889), including some new utility functions and exception handling and new (conditional) definition of type bool. Added some new logic concerning Python and Mono environment and search paths. Fixed problem with Mono updateStatus function. Changed response_print.h to #include locale.h unconditionally and xlocale.h conditionally; xlocale.h is non-standard and can probably be dropped.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/prototype-v0/zoo-project/zoo-kernel/service.h

    r890 r896  
    3232#else
    3333#define ZOO_DLL_EXPORT
     34#endif
     35
     36 // knut: add bool if necessary
     37#ifndef __cplusplus
     38#ifndef WIN32
     39#include <stdbool.h>
     40#else
     41typedef int bool;
     42#define false 0
     43#define true 1 
     44#endif
     45#endif
     46#ifndef __bool_true_false_are_defined
     47#define __bool_true_false_are_defined 1
    3448#endif
    3549
     
    229243#ifdef WIN32
    230244#define NULLMAP ((map*) 0)
    231 #define bool int
    232 #define true 1
    233 #define false 0
     245// knut: see new definition above
     246//#define bool int
     247//#define true 1
     248//#define false 0
    234249#else
    235250#define NULLMAP NULL
     
    303318    struct registry* next; //!< the next registry pointer
    304319  } registry;
     320
     321  // knut
     322  enum WPSException {
     323          /*
     324          * StatusOK is not a WPS exception, it is added
     325          * here for convenience.
     326          */
     327          StatusOK,
     328          /*
     329          * See WPS 1.0 specification, Table 38 and Table 62.
     330          */
     331          MissingParameterValue,
     332          InvalidParameterValue,
     333          NoApplicableCode,
     334          NotEnoughStorage,
     335          ServerBusy,
     336          FileSizeExceeded,
     337          StorageNotSupported,
     338          VersionNegotiationFailed,
     339          /*
     340          * See WPS 2.0 specification, Tables 41, 46, 48, and 50.
     341          */
     342          NoSuchProcess,
     343          NoSuchMode,
     344          NoSuchInput,
     345          NoSuchOutput,
     346          DataNotAccessible,
     347          SizeExceeded,
     348          TooManyInputs,
     349          TooManyOutputs,
     350          NoSuchFormat,
     351          WrongInputData,
     352          InternalServerError,
     353          NoSuchJob,
     354          ResultNotReady
     355  };
     356
     357  static const char* const WPSExceptionCode[] = {
     358        "StatusOK",
     359        "MissingParameterValue",
     360        "InvalidParameterValue",
     361        "NoApplicableCode",
     362        "NotEnoughStorage",
     363        "ServerBusy",
     364        "FileSizeExceeded",
     365        "StorageNotSupported",
     366        "VersionNegotiationFailed",
     367        "NoSuchProcess",
     368        "NoSuchMode",
     369        "NoSuchInput",
     370        "NoSuchOutput",
     371        "DataNotAccessible",
     372        "SizeExceeded",
     373        "TooManyInputs",
     374        "TooManyOutputs",
     375        "NoSuchFormat",
     376        "WrongInputData",
     377        "InternalServerError",
     378        "NoSuchJob",
     379        "ResultNotReady"
     380  };
     381
     382  static const char* const WPSExceptionText[] = {
     383        "No problem detected",
     384        "Operation request does not include a parameter value, and this server did not declare a default value for that parameter.",
     385        "Operation request contains an invalid parameter value.",
     386        "No other exceptionCode specified by this service and server applies to this exception.",
     387        "The server does not have enough space available to store the inputs and outputs associated with the request.",
     388        "The server is too busy to accept and queue the request at this time.",
     389        "The file size of one of the input parameters was too large for this process to handle.",
     390        "Execute operation request included transmission=”reference” for one of the outputs, but storage is not offered by this server.",
     391        "Service version for a ComplexData xlink:href input was not supported by the referenced server, and version negotiation failed.",
     392        "One of the identifiers passed does not match with any of the processes offered by this server.",
     393        "The process does not permit the desired execution mode.",
     394        "One or more of the input identifiers passed does not match with any of the input identifiers of this process.",
     395        "One or more of the output identifiers passed does not match with any of the input identifiers of this process.",
     396        "One of the referenced input data sets was inaccessible.",
     397        "The size of one of the input parameters was too large for this process to handle.",
     398        "Too many input items have been specified.",
     399        "Too many output items have been specified.",
     400        "One or more of the input or output formats specified in the request did not match with any of the formats defined for that particular input or output.",
     401        "One or more of inputs for which the service was able to retrieve the data but could not read it.",
     402        "",
     403        "The JobID from the request does not match any of the Jobs running on this server.",
     404        "The result for the requested JobID has not yet been generated."
     405  };
    305406
    306407  ZOO_DLL_EXPORT void _dumpMap(map*);
     
    370471  ZOO_DLL_EXPORT int snprintf(char *buffer, size_t n, const char *format, ...);
    371472#endif
     473
     474  // knut: some new utility functions; logMessage is primarily intended for debugging   
     475  ZOO_DLL_EXPORT bool nonempty(map* map);
     476  ZOO_DLL_EXPORT bool hasvalue(maps* source, const char* node, const char* key, map** kvp);
     477  ZOO_DLL_EXPORT void setErrorMessage(maps*& conf, const char* service, WPSException exc, const char* message = NULL);
     478  ZOO_DLL_EXPORT void logMessage(const char* source, const char* function, int line, const char* file = NULL, const char* message = NULL);
     479  #define zooLogMsg(file,message) logMessage(__FILE__, __func__, __LINE__, (file), (message))
     480  #define zooLog logMessage(__FILE__, __func__, __LINE__) 
     481
    372482#ifdef __cplusplus
    373483}
Note: See TracChangeset for help on using the changeset viewer.

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