Small structure that is only defined locally to retrieve errors. More...
#include <Plumed.h>
Public Attributes | |
int | code |
code used for translating messages More... | |
int | error_code |
error code for system_error More... | |
const char * | what |
message More... | |
char * | what_buffer |
the buffer containing the message to be deallocated More... | |
Small structure that is only defined locally to retrieve errors.
It is supposed to be used in the C11/C++ plumed_cmd interface as follows:
plumed p; plumed_error error; p=plumed_create(); plumed_cmd(p,"setNatoms",10,&error); if(error.code) { fprintf(errors,"%d\n",error.code); plumed_error_finalize(error); // make sure the error object is finalized! } // if no error was raised (error.code==0), it is not necessary to call plumed_error_finalize. // but doing it is harmless // no need to initialize error, it is written in the plumed_cmd function plumed_cmd(p,"init",&error); if(error.code) { fprintf(errors,"%d\n",error.code); plumed_error_finalize(error); // make sure the error object is finalized! }
The layout of this structure is subject to change, and functions manipulating it are defined as inline/static functions.
int plumed_error::code |
code used for translating messages
int plumed_error::error_code |
error code for system_error
const char* plumed_error::what |
message
char* plumed_error::what_buffer |
the buffer containing the message to be deallocated
Hosted by GitHub | 1.8.17 |