/usr/include/ga/gaerror.h is in libga-dev 1:2.4.7-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | // $Header$
/* ----------------------------------------------------------------------------
error.h
mbwall 7may95
Copyright (c) 1995 Massachusetts Institute of Technology
all rights reserved
DESCRIPTION:
This defines the error routines for handling errors.
---------------------------------------------------------------------------- */
#ifndef _ga_error_h_
#define _ga_error_h_
#include <ga/gatypes.h>
#include <ga/gaconfig.h>
#include <ga/std_stream.h>
// This object is for telling us where in the source code an error occurs.
class GASourceLocator {
public:
GASourceLocator(const char* f, long l) : file(f), line(l) {}
const char* file;
long line;
};
#define GA_LOC GASourceLocator(__FILE__, __LINE__)
// These are the indices for all of the error messages used in the library.
enum GAErrorIndex {
// general errors
gaErrReadError=0,
gaErrWriteError,
gaErrUnexpectedEOF,
gaErrBadProbValue,
gaErrObjectTypeMismatch,
gaErrOpUndef,
gaErrRefsRemain,
// errors for the GA objects
gaErrNeedRS,
gaErrBadRS,
gaErrBadCS,
gaErrBadPRepl,
gaErrBadNRepl,
gaErrBadPopIndex,
gaErrNoIndividuals,
gaErrBadPopSize,
gaErrNoSexualMating,
gaErrNoAsexualMating,
// errors for the genome and crossover objects
gaErrSameBehavReqd,
gaErrSameLengthReqd,
gaErrBadParentLength,
gaErrBadResizeBehaviour,
gaErrBadPhenotypeID,
gaErrBadPhenotypeValue,
gaErrBadBndsDim,
// scaling scheme error messages
gaErrBadLinearScalingMult,
gaErrBadSigmaTruncationMult,
gaErrNegFitness,
gaErrPowerNegFitness,
gaErrBadSharingCutoff,
// miscellaneous error messages from various data objects
gaErrNoAlleleIndex,
gaErrBinStrTooLong,
gaErrDataLost,
gaErrBadWhereIndicator,
gaErrBadTypeIndicator,
gaErrBadTreeLinks,
gaErrCannotSwapAncestors,
gaErrCannotInsertIntoSelf,
gaErrCannotInsertOnNilNode,
gaErrCannotInsertWithSiblings,
gaErrCannotInsertBeforeRoot,
gaErrCannotInsertAfterRoot
};
// Error messages will look like this: (assuming that you use streams)
//
// GASimpleGA::function:
// this is the error message
// /usr/people/jimmyboy/doughhead.C : XXX
//
// GAGenome::function:
// primary error message
// additional error messages go here
// /usr/people/algore/distribute_your_intelligence.C : XXX
//
// MyOwnFunction:
// primary error message
// additional error messages go here
// /usr/people/algore/distribute_your_intelligence.C : XXX
//
void GAErr(const GASourceLocator loc,
const char *clss, const char *function_name,
GAErrorIndex i, const char *msg2=0, const char *msg3=0);
void GAErr(const GASourceLocator loc,
const char *clss, const char *function_name,
const char *msg1, const char *msg2=0, const char *msg3=0);
void GAErr(const GASourceLocator loc,
const char *function_name,
GAErrorIndex i, const char *msg2=0, const char *msg3=0);
// Use this function to turn on/off the error reporting. If you turn off the
// error reporting, the messages will still get stuck into the global error
// message string, but they will not be sent to the error stream.
void GAReportErrors(GABoolean flag);
// Provide a mechanism for redirecting the error messages.
#ifdef GALIB_USE_STREAMS
void GASetErrorStream(STD_OSTREAM &);
#else
inline void GASetErrorStream(){} // dummy function
#endif
// This error string contains the text of the most recent error message. If a
// GAlib function returns an error code, this string will contain the text of
// the explanation for the error.
extern char gaErrMsg[];
#endif
|