// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* // ** Copyright UCAR (c) 1992 - 2015 // ** University Corporation for Atmospheric Research(UCAR) // ** National Center for Atmospheric Research(NCAR) // ** Research Applications Laboratory(RAL) // ** P.O.Box 3000, Boulder, Colorado, 80307-3000, USA // ** See LICENCE.TXT if applicable for licence details // ** 2015/05/29 22:31:26 UTC // *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* //////////////////////////////////////////// // ParamsSetUV.hh // // TDRP header file for 'ParamsSetUV' class. // // This header file has been automatically // generated by TDRP, do not modify. // ///////////////////////////////////////////// /** * * @file Params.hh * * This class is automatically generated by the Table * Driven Runtime Parameters (TDRP) system * * @class Params * * @author automatically generated * */ #ifndef ParamsSetUV_hh #define ParamsSetUV_hh using namespace std; #include #include #include #include #include #include #include // Class definition class ParamsSetUV { public: // struct typedefs typedef struct { char* name; double threshold; double fractional_area_data_threshold; double alpha; double variance; } data_t; typedef struct { double distance; double value; } fuzzy_f; /////////////////////////// // Member functions // //////////////////////////////////////////// // Default constructor // ParamsSetUV (); //////////////////////////////////////////// // Copy constructor // ParamsSetUV (const ParamsSetUV&); //////////////////////////////////////////// // Destructor // ~ParamsSetUV (); //////////////////////////////////////////// // Assignment // void operator=(const ParamsSetUV&); //////////////////////////////////////////// // loadFromArgs() // // Loads up TDRP using the command line args. // // Check usage() for command line actions associated with // this function. // // argc, argv: command line args // // char **override_list: A null-terminated list of overrides // to the parameter file. // An override string has exactly the format of an entry // in the parameter file itself. // // char **params_path_p: // If this is non-NULL, it is set to point to the path // of the params file used. // // bool defer_exit: normally, if the command args contain a // print or check request, this function will call exit(). // If defer_exit is set, such an exit is deferred and the // private member _exitDeferred is set. // Use exidDeferred() to test this flag. // // Returns 0 on success, -1 on failure. // int loadFromArgs(int argc, char **argv, char **override_list, char **params_path_p, bool defer_exit = false); bool exitDeferred() { return (_exitDeferred); } //////////////////////////////////////////// // loadApplyArgs() // // Loads up TDRP using the params path passed in, and applies // the command line args for printing and checking. // // Check usage() for command line actions associated with // this function. // // const char *param_file_path: the parameter file to be read in // // argc, argv: command line args // // char **override_list: A null-terminated list of overrides // to the parameter file. // An override string has exactly the format of an entry // in the parameter file itself. // // bool defer_exit: normally, if the command args contain a // print or check request, this function will call exit(). // If defer_exit is set, such an exit is deferred and the // private member _exitDeferred is set. // Use exidDeferred() to test this flag. // // Returns 0 on success, -1 on failure. // int loadApplyArgs(const char *params_path, int argc, char **argv, char **override_list, bool defer_exit = false); //////////////////////////////////////////// // isArgValid() // // Check if a command line arg is a valid TDRP arg. // static bool isArgValid(const char *arg); //////////////////////////////////////////// // load() // // Loads up TDRP for a given class. // // This version of load gives the programmer the option to load // up more than one class for a single application. It is a // lower-level routine than loadFromArgs, and hence more // flexible, but the programmer must do more work. // // const char *param_file_path: the parameter file to be read in. // // char **override_list: A null-terminated list of overrides // to the parameter file. // An override string has exactly the format of an entry // in the parameter file itself. // // expand_env: flag to control environment variable // expansion during tokenization. // If TRUE, environment expansion is set on. // If FALSE, environment expansion is set off. // // Returns 0 on success, -1 on failure. // int load(const char *param_file_path, char **override_list, int expand_env, int debug); //////////////////////////////////////////// // loadFromBuf() // // Loads up TDRP for a given class. // // This version of load gives the programmer the option to // load up more than one module for a single application, // using buffers which have been read from a specified source. // // const char *param_source_str: a string which describes the // source of the parameter information. It is used for // error reporting only. // // char **override_list: A null-terminated list of overrides // to the parameter file. // An override string has exactly the format of an entry // in the parameter file itself. // // const char *inbuf: the input buffer // // int inlen: length of the input buffer // // int start_line_num: the line number in the source which // corresponds to the start of the buffer. // // expand_env: flag to control environment variable // expansion during tokenization. // If TRUE, environment expansion is set on. // If FALSE, environment expansion is set off. // // Returns 0 on success, -1 on failure. // int loadFromBuf(const char *param_source_str, char **override_list, const char *inbuf, int inlen, int start_line_num, int expand_env, int debug); //////////////////////////////////////////// // loadDefaults() // // Loads up default params for a given class. // // See load() for more detailed info. // // Returns 0 on success, -1 on failure. // int loadDefaults(int expand_env); //////////////////////////////////////////// // sync() // // Syncs the user struct data back into the parameter table, // in preparation for printing. // // This function alters the table in a consistent manner. // Therefore it can be regarded as const. // void sync() const; //////////////////////////////////////////// // print() // // Print params file // // The modes supported are: // // PRINT_SHORT: main comments only, no help or descriptions // structs and arrays on a single line // PRINT_NORM: short + descriptions and help // PRINT_LONG: norm + arrays and structs expanded // PRINT_VERBOSE: long + private params included // void print(FILE *out, tdrp_print_mode_t mode = PRINT_NORM); //////////////////////////////////////////// // checkAllSet() // // Return TRUE if all set, FALSE if not. // // If out is non-NULL, prints out warning messages for those // parameters which are not set. // int checkAllSet(FILE *out); ////////////////////////////////////////////////////////////// // checkIsSet() // // Return TRUE if parameter is set, FALSE if not. // // int checkIsSet(const char *param_name); //////////////////////////////////////////// // arrayRealloc() // // Realloc 1D array. // // If size is increased, the values from the last array // entry is copied into the new space. // // Returns 0 on success, -1 on error. // int arrayRealloc(const char *param_name, int new_array_n); //////////////////////////////////////////// // array2DRealloc() // // Realloc 2D array. // // If size is increased, the values from the last array // entry is copied into the new space. // // Returns 0 on success, -1 on error. // int array2DRealloc(const char *param_name, int new_array_n1, int new_array_n2); //////////////////////////////////////////// // freeAll() // // Frees up all TDRP dynamic memory. // void freeAll(void); //////////////////////////////////////////// // usage() // // Prints out usage message for TDRP args as passed // in to loadFromArgs(). // static void usage(ostream &out); /////////////////////////// // Data Members // char _start_; // start of data region // needed for zeroing out data // and computing offsets data_t *_data; int data_n; int forecast_input_smooth; int verif_input_smooth; int low_res_ngridpts; int *_volume_size; int volume_size_n; int *_volume_overlap; int volume_overlap_n; int phase_shift_res_npt; int max_phase_shift; int refine_phase_shift_res_npt; int refine_max_phase_shift; int *_low_res_motion_smooth; int low_res_motion_smooth_n; int *_high_res_motion_smooth; int high_res_motion_smooth_n; int high_res_gap_fill; int *_high_res_output_fcst_smooth; int high_res_output_fcst_smooth_n; tdrp_bool_t exclude_zero_from_smoothing; int high_res_max_expand_npt; double good_scaling; double good_dist_scaling; fuzzy_f *_fuzzy_grid_distance; int fuzzy_grid_distance_n; double fractional_area_min_pcnt; double grid_area_min_pcnt; char _end_; // end of data region // needed for zeroing out data private: void _init(); mutable TDRPtable _table[24]; const char *_className; bool _exitDeferred; }; #endif