Gromacs
5.1.5
|
#include "gmxpre.h"
#include "selmethod.h"
#include <ctype.h>
#include <stdarg.h>
#include "gromacs/legacyheaders/macros.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/exceptions.h"
#include "symrec.h"
Implements functions in selmethod.h.
Classes | |
struct | t_register_method |
Helper structure for defining selection methods. More... | |
Functions | |
static void | report_error (FILE *fp, const char *name, const char *fmt,...) |
Convenience function for reporting errors found in selection methods. | |
static void | report_param_error (FILE *fp, const char *mname, const char *pname, const char *fmt,...) |
Convenience function for reporting errors found in selection method parameters. | |
static bool | check_params (FILE *fp, const char *name, int nparams, gmx_ana_selparam_t param[], const gmx::SelectionParserSymbolTable &symtab) |
Checks the validity of parameters. More... | |
static bool | check_callbacks (FILE *fp, gmx_ana_selmethod_t *method) |
Checks the validity of selection method callback functions. More... | |
static bool | check_method (FILE *fp, gmx_ana_selmethod_t *method, const gmx::SelectionParserSymbolTable &symtab) |
Checks the validity of a selection method. More... | |
static bool | check_modifier (FILE *fp, gmx_ana_selmethod_t *method, const gmx::SelectionParserSymbolTable &symtab) |
Checks the validity of a selection modifier method. More... | |
int | gmx_ana_selmethod_register (gmx::SelectionParserSymbolTable *symtab, const char *name, gmx_ana_selmethod_t *method) |
Registers a selection method. More... | |
int | gmx_ana_selmethod_register_defaults (gmx::SelectionParserSymbolTable *symtab) |
Registers all selection methods in the library. More... | |
gmx_ana_selparam_t * | gmx_ana_selmethod_find_param (const char *name, gmx_ana_selmethod_t *method) |
Finds a parameter from a selection method by name. More... | |
Variables | |
gmx_ana_selmethod_t | sm_cog |
Selection method data for the cog method. More... | |
gmx_ana_selmethod_t | sm_com |
Selection method data for the com method. More... | |
gmx_ana_selmethod_t | sm_all |
Selection method data for all selection keyword. More... | |
gmx_ana_selmethod_t | sm_none |
Selection method data for none selection keyword. More... | |
gmx_ana_selmethod_t | sm_atomnr |
Selection method data for atomnr selection keyword. More... | |
gmx_ana_selmethod_t | sm_resnr |
Selection method data for resnr selection keyword. More... | |
gmx_ana_selmethod_t | sm_resindex |
Selection method data for resindex selection keyword. More... | |
gmx_ana_selmethod_t | sm_molindex |
Selection method data for molindex selection keyword. More... | |
gmx_ana_selmethod_t | sm_atomname |
Selection method data for atomname selection keyword. More... | |
gmx_ana_selmethod_t | sm_pdbatomname |
Selection method data for pdbatomname selection keyword. More... | |
gmx_ana_selmethod_t | sm_atomtype |
Selection method data for atomtype selection keyword. More... | |
gmx_ana_selmethod_t | sm_resname |
Selection method data for resname selection keyword. More... | |
gmx_ana_selmethod_t | sm_insertcode |
Selection method data for chain selection keyword. More... | |
gmx_ana_selmethod_t | sm_chain |
Selection method data for chain selection keyword. More... | |
gmx_ana_selmethod_t | sm_mass |
Selection method data for mass selection keyword. More... | |
gmx_ana_selmethod_t | sm_charge |
Selection method data for charge selection keyword. More... | |
gmx_ana_selmethod_t | sm_altloc |
Selection method data for chain selection keyword. More... | |
gmx_ana_selmethod_t | sm_occupancy |
Selection method data for occupancy selection keyword. More... | |
gmx_ana_selmethod_t | sm_betafactor |
Selection method data for betafactor selection keyword. More... | |
gmx_ana_selmethod_t | sm_x |
Selection method data for x selection keyword. More... | |
gmx_ana_selmethod_t | sm_y |
Selection method data for y selection keyword. More... | |
gmx_ana_selmethod_t | sm_z |
Selection method data for z selection keyword. More... | |
gmx_ana_selmethod_t | sm_distance |
Selection method data for the distance method. More... | |
gmx_ana_selmethod_t | sm_mindistance |
Selection method data for the distance method. More... | |
gmx_ana_selmethod_t | sm_within |
Selection method data for the within method. More... | |
gmx_ana_selmethod_t | sm_insolidangle |
Selection method data for the insolidangle method. More... | |
gmx_ana_selmethod_t | sm_same |
Selection method data for the same method. More... | |
gmx_ana_selmethod_t | sm_merge |
Selection method data for the plus modifier. More... | |
gmx_ana_selmethod_t | sm_plus |
Selection method data for the plus modifier. More... | |
gmx_ana_selmethod_t | sm_permute |
Selection method data for the permute modifier. More... | |
static const t_register_method | smtable_def [] |
Array of selection methods defined in the library. More... | |
|
static |
Checks the validity of selection method callback functions.
[in] | fp | File handle to use for diagnostic messages (can be NULL). |
[in] | method | The method to check. |
This function performs some checks common to both check_method() and check_modifier(). This function checks that all the required callbacks are defined, i.e., not NULL, to find programming errors.
|
static |
Checks the validity of a selection method.
[in] | fp | File handle to use for diagnostic messages (can be NULL). |
[in,out] | method | Method to check. |
[in] | symtab | Symbol table (used for checking overlaps). |
Checks the validity of the given selection method data structure that does not have SMETH_MODIFIER set. If you remove a check, please make sure that the selection parser, compiler, and evaluation functions can deal with the method.
|
static |
Checks the validity of a selection modifier method.
[in] | fp | File handle to use for diagnostic messages (can be NULL). |
[in,out] | method | Method to check. |
[in] | symtab | Symbol table (used for checking overlaps). |
Checks the validity of the given selection method data structure that has SMETH_MODIFIER set. If you remove a check, please make sure that the selection parser, compiler, and evaluation functions can deal with the method.
|
static |
Checks the validity of parameters.
[in] | fp | File handle to use for diagnostic messages (can be NULL). |
[in] | name | Name of the method (used for error messages). |
[in] | nparams | Number of parameters in param . |
[in,out] | param | Parameter array (only the flags field of boolean parameters may be modified). |
[in] | symtab | Symbol table (used for checking overlaps). |
This function performs some checks common to both check_method() and check_modifier(). The purpose of these checks is to ensure that the selection parser does not need to check for the validity of the parameters at each turn, and to report programming errors as early as possible. If you remove a check, make sure that the parameter parser can handle the resulting parameters.
gmx_ana_selparam_t* gmx_ana_selmethod_find_param | ( | const char * | name, |
gmx_ana_selmethod_t * | method | ||
) |
Finds a parameter from a selection method by name.
[in] | name | Name of the parameter to search. |
[in] | method | Method to search for the parameter. |
name
was found.This is a simple wrapper for gmx_ana_selparam_find().
int gmx_ana_selmethod_register | ( | gmx::SelectionParserSymbolTable * | symtab, |
const char * | name, | ||
gmx_ana_selmethod_t * | method | ||
) |
Registers a selection method.
[in,out] | symtab | Symbol table to register the method to. |
[in] | name | Name under which the method should be registered. |
[in] | method | Method to register. |
name
does not need to match the name of the method, and the same method can be registered multiple times under different names. If name
equals some previously registered name, an error message is printed and the method is not registered.
The function also performs some sanity checking on the input method, and refuses to register it if there are problems. Some problems only generate warnings. All problems are described to stderr
.
int gmx_ana_selmethod_register_defaults | ( | gmx::SelectionParserSymbolTable * | symtab | ) |
Registers all selection methods in the library.
[in,out] | symtab | Symbol table to register the methods to. |
gmx_ana_selmethod_t sm_all |
Selection method data for all
selection keyword.
gmx_ana_selmethod_t sm_altloc |
Selection method data for chain
selection keyword.
gmx_ana_selmethod_t sm_atomname |
Selection method data for atomname
selection keyword.
gmx_ana_selmethod_t sm_atomnr |
Selection method data for atomnr
selection keyword.
gmx_ana_selmethod_t sm_atomtype |
Selection method data for atomtype
selection keyword.
gmx_ana_selmethod_t sm_betafactor |
Selection method data for betafactor
selection keyword.
gmx_ana_selmethod_t sm_chain |
Selection method data for chain
selection keyword.
gmx_ana_selmethod_t sm_charge |
Selection method data for charge
selection keyword.
gmx_ana_selmethod_t sm_cog |
Selection method data for the cog
method.
gmx_ana_selmethod_t sm_com |
Selection method data for the com
method.
gmx_ana_selmethod_t sm_distance |
Selection method data for the distance
method.
gmx_ana_selmethod_t sm_insertcode |
Selection method data for chain
selection keyword.
gmx_ana_selmethod_t sm_insolidangle |
Selection method data for the insolidangle
method.
gmx_ana_selmethod_t sm_mass |
Selection method data for mass
selection keyword.
gmx_ana_selmethod_t sm_merge |
Selection method data for the plus
modifier.
gmx_ana_selmethod_t sm_mindistance |
Selection method data for the distance
method.
gmx_ana_selmethod_t sm_molindex |
Selection method data for molindex
selection keyword.
gmx_ana_selmethod_t sm_none |
Selection method data for none
selection keyword.
gmx_ana_selmethod_t sm_occupancy |
Selection method data for occupancy
selection keyword.
gmx_ana_selmethod_t sm_pdbatomname |
Selection method data for pdbatomname
selection keyword.
gmx_ana_selmethod_t sm_permute |
Selection method data for the permute
modifier.
gmx_ana_selmethod_t sm_plus |
Selection method data for the plus
modifier.
gmx_ana_selmethod_t sm_resindex |
Selection method data for resindex
selection keyword.
gmx_ana_selmethod_t sm_resname |
Selection method data for resname
selection keyword.
gmx_ana_selmethod_t sm_resnr |
Selection method data for resnr
selection keyword.
gmx_ana_selmethod_t sm_same |
Selection method data for the same
method.
gmx_ana_selmethod_t sm_within |
Selection method data for the within
method.
gmx_ana_selmethod_t sm_x |
Selection method data for x
selection keyword.
gmx_ana_selmethod_t sm_y |
Selection method data for y
selection keyword.
gmx_ana_selmethod_t sm_z |
Selection method data for z
selection keyword.
|
static |
Array of selection methods defined in the library.