OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Protected Attributes | List of all members
BaseException Class Reference

#include <myexcept.h>

Inheritance diagram for BaseException:
Bad_alloc Logic_error Runtime_error CannotBuildException Domain_error IncompatibleDimensionsException IndexException InternalException Invalid_argument Length_error NotDefinedException NotSquareException Out_of_range ProgramException SubMatrixDimensionException VectorException ConvergenceException NPDException Overflow_error OverflowException Range_error SingularException

Public Member Functions

 BaseException (const char *a_what=0)
 

Static Public Member Functions

static void AddMessage (const char *a_what)
 
static void AddInt (int value)
 
static const char * what ()
 

Static Public Attributes

static unsigned long Select
 

Static Protected Attributes

static char * what_error
 
static int SoFar
 
static int LastOne
 

Detailed Description

Definition at line 69 of file myexcept.h.

Constructor & Destructor Documentation

◆ BaseException()

BaseException::BaseException ( const char *  a_what = 0)

Definition at line 49 of file myexcept.cpp.

References Tracer::AddTrace().

50 {
51  Select++; SoFar = 0;
52  if (!what_error) // make space for exception message
53  {
54  LastOne = 511;
55  what_error = new char[512];
56  if (!what_error) // fail to make space
57  {
58  LastOne = 0;
59  what_error = (char *)"No heap space for exception message\n";
60  }
61  }
62  AddMessage("\n\nAn exception has been thrown\n");
63  AddMessage(a_what);
64  if (a_what) Tracer::AddTrace();
65 }
static void AddMessage(const char *a_what)
Definition: myexcept.cpp:67
static void AddTrace()
Definition: myexcept.cpp:110
static int SoFar
Definition: myexcept.h:73
static int LastOne
Definition: myexcept.h:74
static unsigned long Select
Definition: myexcept.h:79
static char * what_error
Definition: myexcept.h:72

Member Function Documentation

◆ AddInt()

void BaseException::AddInt ( int  value)
static

Definition at line 82 of file myexcept.cpp.

References n.

Referenced by IndexException::IndexException().

83 {
84  bool negative;
85  if (value == 0) { AddMessage("0"); return; }
86  else if (value < 0) { value = -value; negative = true; }
87  else negative = false;
88  int n = 0; int v = value; // how many digits will we need?
89  while (v > 0) { v /= 10; n++; }
90  if (negative) n++;
91  if (LastOne-SoFar < n) { AddMessage("***"); return; }
92 
93  SoFar += n; n = SoFar; what_error[n] = 0;
94  while (value > 0)
95  {
96  int nv = value / 10; int rm = value - nv * 10; value = nv;
97  what_error[--n] = (char)(rm + '0');
98  }
99  if (negative) what_error[--n] = '-';
100  return;
101 }
static void AddMessage(const char *a_what)
Definition: myexcept.cpp:67
os2<< "> n<< " > nendobj n
static int SoFar
Definition: myexcept.h:73
static int LastOne
Definition: myexcept.h:74
static char * what_error
Definition: myexcept.h:72

◆ AddMessage()

void BaseException::AddMessage ( const char *  a_what)
static

◆ what()

static const char* BaseException::what ( )
inlinestatic

Definition at line 81 of file myexcept.h.

Referenced by Terminate().

81 { return what_error; }
static char * what_error
Definition: myexcept.h:72

Member Data Documentation

◆ LastOne

int BaseException::LastOne
staticprotected

Definition at line 74 of file myexcept.h.

◆ Select

unsigned long BaseException::Select
static

◆ SoFar

int BaseException::SoFar
staticprotected

Definition at line 73 of file myexcept.h.

◆ what_error

char * BaseException::what_error
staticprotected

Definition at line 72 of file myexcept.h.


The documentation for this class was generated from the following files: