CP2K 2.5 (Revision 12981)
Classes | Functions | Variables

input_enumeration_types Namespace Reference

represents an enumeration, i.e. a mapping between integers and strings More...

Classes

struct  enumeration_type
 represents an enumaration, i.e. a mapping between strings and numbers More...

Functions

subroutine, public enum_create (enum, c_vals, i_vals, desc, strict, error)
 creates an enumeration
subroutine, public enum_retain (enum, error)
 retains the given enumeration
subroutine, public enum_release (enum, error)
 releases the given enumeration
CHARACTER(len=default_string_length),
public 
enum_i2c (enum, i, error)
 maps an integer to a string
INTEGER, public enum_c2i (enum, c, error)
 maps a string to an integer

Variables

LOGICAL, parameter, private debug_this_module = .TRUE.
CHARACTER(len=*), parameter,
private 
moduleN = 'input_enumeration_types'
INTEGER, save, private last_enumeration_id = 0
INTEGER, parameter, private keyword_desc_length = 5*default_string_length

Detailed Description

represents an enumeration, i.e. a mapping between integers and strings

History
08.2004 created [fawzi]
Author:
fawzi

Function Documentation

INTEGER,public input_enumeration_types::enum_c2i ( TYPE(enumeration_type),pointer  enum,
CHARACTER(len=*),intent(in)  c,
TYPE(cp_error_type),intent(inout)  error 
)

maps a string to an integer

Parameters:
enumthe enumeration to use for the mapping
cthe value to map
errorvariable to control error logging, stopping,... see module cp_error_handling
Author:
fawzi

Definition at line 231 of file input_enumeration_types.f90.

References string_utilities::uppercase().

Referenced by input_parsing::val_create_parsing().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public input_enumeration_types::enum_create ( TYPE(enumeration_type),pointer  enum,
CHARACTER(len=*),dimension(:),intent(in)  c_vals,
INTEGER,dimension(:),intent(in)  i_vals,
CHARACTER(len=*),dimension(:),intent(in),optional  desc,
LOGICAL,intent(in),optional  strict,
TYPE(cp_error_type),intent(inout)  error 
)

creates an enumeration

Parameters:
enumthe enumeration to be created
c_valsstring values
i_valsinteger values
strictif integer values not in the list should be accepted, defaults defaults to true
errorvariable to control error logging, stopping,... see module cp_error_handling
Author:
fawzi

Definition at line 59 of file input_enumeration_types.f90.

References CPPostcondition, last_enumeration_id, and string_utilities::uppercase().

Referenced by input_keyword_types::keyword_create().

Here is the call graph for this function:

Here is the caller graph for this function:

CHARACTER(len=default_string_length),public input_enumeration_types::enum_i2c ( TYPE(enumeration_type),pointer  enum,
INTEGER,intent(in)  i,
TYPE(cp_error_type),intent(inout)  error 
)
subroutine,public input_enumeration_types::enum_release ( TYPE(enumeration_type),pointer  enum,
TYPE(cp_error_type),intent(inout)  error 
)

releases the given enumeration

Parameters:
enumthe obect to release
errorvariable to control error logging, stopping,... see module cp_error_handling
Author:
fawzi

Definition at line 145 of file input_enumeration_types.f90.

References CPPostcondition, and CPPreconditionNoFail.

subroutine,public input_enumeration_types::enum_retain ( TYPE(enumeration_type),pointer  enum,
TYPE(cp_error_type),intent(inout)  error 
)

retains the given enumeration

Parameters:
enumthe obect to retain
errorvariable to control error logging, stopping,... see module cp_error_handling
Author:
fawzi

Definition at line 121 of file input_enumeration_types.f90.

References CPPreconditionNoFail.


Variable Documentation

LOGICAL,parameter,private input_enumeration_types::debug_this_module = .TRUE.

Definition at line 21 of file input_enumeration_types.f90.

INTEGER,parameter,private input_enumeration_types::keyword_desc_length = 5*default_string_length

Definition at line 25 of file input_enumeration_types.f90.

Definition at line 23 of file input_enumeration_types.f90.

Referenced by enum_create().

CHARACTER(len=*),parameter,private input_enumeration_types::moduleN = 'input_enumeration_types'

Definition at line 22 of file input_enumeration_types.f90.