Changes between Version 17 and Version 18 of ValidationSimple


Ignore:
Timestamp:
Oct 9, 2011, 10:21:15 AM (13 years ago)
Author:
cries
Comment:

Variable name change because previous one is nowhere defined.

Legend:

Unmodified
Added
Removed
Modified
  • ValidationSimple

    v17 v18  
    11= Developing a custom validator =
     2To create a validator using the BOINC framework, you must supply three functions:
    23
    3 To create a validator using the BOINC framework, you must supply three functions:
    44{{{
    55extern int init_result(RESULT& result, void*& data);
    66}}}
    7 This takes a result, reads its output file(s), parses them into a memory structure,
    8 and returns (via the 'data' argument) a pointer to this structure.
    9 It returns:
     7This takes a result, reads its output file(s), parses them into a memory structure, and returns (via the 'data' argument) a pointer to this structure. It returns:
    108
    119 * Zero on success,
    12  * ERR_OPENDIR if there was a transient error, e.g. the output file is on a network volume that is not available.
    13   The validator will try this result again later.
    14  * Any other return value indicates a permanent error.
    15   Example: an output file is missing, or has a syntax error.
    16   The result will be marked as invalid.
     10 * ERR_OPENDIR if there was a transient error, e.g. the output file is on a network volume that is not available. The validator will try this result again later.
     11 * Any other return value indicates a permanent error. Example: an output file is missing, or has a syntax error. The result will be marked as invalid.
    1712
    1813{{{
     
    2116);
    2217}}}
    23 This takes two results and their associated memory structures.
    24 It returns (via the 'match' argument) true if the two results are equivalent (within the tolerances of the application).
     18This takes two results and their associated memory structures. It returns (via the 'match' argument) true if the two results are equivalent (within the tolerances of the application).
     19
    2520{{{
    2621extern int cleanup_result(RESULT& r, void* data);
     
    2823This frees the structure pointed to by data, if it's non-NULL.
    2924
    30 You must link these functions with the files validator.cpp, validate_util.cpp, and validate_util2.cpp.
    31 The result is your custom validator.
     25You must link these functions with the files validator.cpp, validate_util.cpp, and validate_util2.cpp. The result is your custom validator.
    3226
    3327If for some reason you need to access the WORKUNIT in your init_result() etc. functions:
     28
    3429{{{
    3530DB_WORKUNIT wu;
    36 wu.lookup_id(g_wup->id);
     31wu.lookup_id(result->id);
    3732}}}
     33== Example ==
     34Here's an example in which the output file contains an integer and a double. Two results are considered equivalent if the integer is equal and the doubles differ by no more than 0.01.
    3835
    39 == Example ==
     36This example uses [wiki:BackendUtilities utility functions] get_output_file_path() and try_fopen().
    4037
    41 Here's an example in which the output file contains an integer and a double.
    42 Two results are considered equivalent if the integer is equal and the doubles differ by no more than 0.01.
    43 
    44 This example uses [BackendUtilities utility functions] get_output_file_path() and try_fopen().
    4538{{{
    4639#include <string>