Gromacs  2022.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
#include "gmxpre.h"
#include "selelem.h"
#include <cstring>
#include "gromacs/selection/indexutil.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/utility/stringutil.h"
#include "keywords.h"
#include "mempool.h"
#include "poscalc.h"
#include "position.h"
#include "selectionenums.h"
#include "selmethod.h"
+ Include dependency graph for selelem.cpp:

Description

Implements functions in selelem.h.

Author
Teemu Murtola teemu.nosp@m..mur.nosp@m.tola@.nosp@m.gmai.nosp@m.l.com

Functions

const char * _gmx_selelem_type_str (const gmx::SelectionTreeElement &sel)
 Returns a string representation of the type of a gmx::SelectionTreeElement. More...
 
const char * _gmx_sel_value_type_str (const gmx_ana_selvalue_t *val)
 Returns a string representation of the type of a gmx_ana_selvalue_t. More...
 
const char * _gmx_selelem_boolean_type_str (const gmx::SelectionTreeElement &sel)
 Returns a string representation of the type of a gmx::SelectionTreeElement. More...
 
void _gmx_selelem_set_vtype (const gmx::SelectionTreeElementPointer &sel, e_selvalue_t vtype)
 Sets the value type of a gmx::SelectionTreeElement. More...
 
void _gmx_selelem_free_param (gmx_ana_selparam_t *param)
 Frees the memory allocated for a selection method parameter. More...
 
void _gmx_selelem_free_method (gmx_ana_selmethod_t *method, void *mdata)
 Frees the memory allocated for a selection method. More...
 
void _gmx_selelem_print_tree (FILE *fp, const gmx::SelectionTreeElement &sel, bool bValues, int level)
 Prints a human-readable version of a selection element subtree. More...
 

Function Documentation

const char* _gmx_sel_value_type_str ( const gmx_ana_selvalue_t val)

Returns a string representation of the type of a gmx_ana_selvalue_t.

Parameters
[in]valValue structore for which the string is requested.
Returns
Pointer to a string that corresponds to val->type, NULL if the type value is invalid.

The return value points to a string constant and should not be free'd.

const char* _gmx_selelem_boolean_type_str ( const gmx::SelectionTreeElement sel)

Returns a string representation of the type of a gmx::SelectionTreeElement.

Returns a string representation of the boolean type of a SEL_BOOLEAN gmx::SelectionTreeElement.

Parameters
[in]selSelection for which the string is requested
Returns
Pointer to a string that corresponds to sel->type.

The return value points to a string constant and should not be free'd.

The function returns NULL if sel->type is not one of the valid values.

void _gmx_selelem_free_method ( struct gmx_ana_selmethod_t method,
void *  mdata 
)

Frees the memory allocated for a selection method.

Parameters
[in]methodMethod to free.
[in]mdataMethod data to free.
void _gmx_selelem_free_param ( struct gmx_ana_selparam_t param)

Frees the memory allocated for a selection method parameter.

Parameters
[in]paramParameter to free.
void _gmx_selelem_print_tree ( FILE *  fp,
const gmx::SelectionTreeElement sel,
bool  bValues,
int  level 
)

Prints a human-readable version of a selection element subtree.

Parameters
[in]fpFile handle to receive the output.
[in]selRoot of the selection subtree to print.
[in]bValuesIf true, the evaluated values of selection elements are printed as well.
[in]levelIndentation level, starting from zero.
void _gmx_selelem_set_vtype ( const gmx::SelectionTreeElementPointer sel,
e_selvalue_t  vtype 
)

Sets the value type of a gmx::SelectionTreeElement.

Parameters
[in,out]selSelection element to set the type for.
[in]vtypeValue type for the selection element.

If the new type is GROUP_VALUE or POS_VALUE, the SEL_ALLOCDATA flag is also set.

This function should only be called at most once for each element, preferably right after calling _gmx_selelem_create().

const char* _gmx_selelem_type_str ( const gmx::SelectionTreeElement sel)

Returns a string representation of the type of a gmx::SelectionTreeElement.

Parameters
[in]selSelection for which the string is requested
Returns
Pointer to a string that corresponds to sel->type.

The return value points to a string constant and should not be free'd.

The function returns NULL if sel->type is not one of the valid values.