mpi $ SuccessOrError :: SELF
Type of this instance, automatically specialized in every classcore :: Pointer :: address_is_null
Is the address behind this Object at NULL?core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: Pointer :: defaultinit
mpi :: SuccessOrError :: defaultinit
core :: Object :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: output_class_name
Display class name on stdout (debug only).
# An MPI return code to report success or errors
extern class SuccessOrError `{ int `}
# Is this a success?
fun is_success: Bool `{ return self == MPI_SUCCESS; `}
# Is this an error?
fun is_error: Bool do return not is_success
# TODO add is_... for each variant
# The class of this error
fun error_class: ErrorClass
`{
int class;
MPI_Error_class(self, &class);
return class;
`}
redef fun to_s do return native_to_s.to_s
private fun native_to_s: CString `{
char *err = malloc(MPI_MAX_ERROR_STRING);
MPI_Error_string(self, err, NULL);
return err;
`}
end
lib/mpi/mpi.nit:322,1--346,3