Generated on Wed Nov 1 15:04:42 2006 for Gecode by doxygen 1.4.5

exception.cc

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Christian Schulte <schulte@gecode.org>
00004  *
00005  *  Copyright:
00006  *     Christian Schulte, 2006
00007  *
00008  *  Last modified:
00009  *     $Date: 2006-07-12 21:37:21 +0200 (Wed, 12 Jul 2006) $ by $Author: schulte $
00010  *     $Revision: 3352 $
00011  *
00012  *  This file is part of Gecode, the generic constraint
00013  *  development environment:
00014  *     http://www.gecode.org
00015  *
00016  *  See the file "LICENSE" for information on usage and
00017  *  redistribution of this file, and for a
00018  *     DISCLAIMER OF ALL WARRANTIES.
00019  *
00020  */
00021 
00022 #include "gecode/kernel.hh"
00023 
00024 namespace Gecode {
00025 
00026   /*
00027    * Base class for exceptions
00028    *
00029    */
00030   Exception::Exception(const char* l, const char* i) throw() {
00031     int j = 0;
00032     while ((*l != 0) && (j < li_max))
00033       li[j++] = *(l++);
00034     if (j < li_max)
00035       li[j++] = ':';
00036     if (j < li_max)
00037       li[j++] = ' ';
00038     while ((*i != 0) && (j < li_max))
00039       li[j++] = *(i++);
00040     li[j] = 0;
00041   }
00042   const char*
00043   Exception::what(void) const throw() {
00044     return &li[0];
00045   }
00046 
00047 }
00048 
00049 // STATISTICS: kernel-other