Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

CTBexceptionIndexRange.cxx

Go to the documentation of this file.
00001 
00006 /*----------------------------------------------------------------------------*/
00007 /* C Tool Box: Designed and implemented by:                                   */
00008 /*    Walter F.J. Mueller   Gesellschaft fuer Schwerionenforschung (GSI)      */
00009 /*                          Planckstrasse 1, D-64291 Darmstadt, Germany       */
00010 /*                  Email:  W.F.J.Mueller@gsi.de                              */
00011 /*                  WWW:    http://www-kp3.gsi.de/www/kp3/people/mueller.html */
00012 /*----------------------------------------------------------------------------*/
00013 
00014 #include "CTB.hxx"
00015 #include "CTBexceptionIndexRange.hxx"
00016 
00022 //------------------------------------------+-----------------------------------
00024 
00025 void CTBexceptionIndexRange::ToStream(ostream& os) const
00026 {
00027   os << mc_name;
00028   os << "- index " << mi_index << " > limit " << mi_limit;
00029   if (mc_module) os << " in " << mc_module;
00030 
00031   return;
00032 }
00033 
00034 //------------------------------------------+-----------------------------------
00040 void CTBindexRangeCheck(CTBint i_ind, CTBint i_limit, const char* c_module)
00041 {
00042   if (i_ind < 0 || i_ind >= i_limit)
00043     throw CTBexceptionIndexRange(i_ind,i_limit,c_module);
00044   return;
00045 }
00046 
00047 //------------------------------------------+-----------------------------------
00053 void CTBindexRangeCheck(const CTBrange& ran, CTBint i_limit, 
00054                         const char* c_module)
00055 {
00056   if (ran.Begin() < 0 || ran.Begin() >= i_limit)
00057     throw CTBexceptionIndexRange(ran.Begin(),i_limit,c_module);
00058   if (ran.End() < 0 || ran.End() >= i_limit)
00059     throw CTBexceptionIndexRange(ran.End(),i_limit,c_module);
00060   return;
00061 }
00062 
00063 
00064 #if (defined(CTB__OutLine) || defined(CTBexceptionIndexRange__OutLine))
00065 #define inline
00066 #include "CTBexceptionIndexRange.icc"
00067 #undef  inline
00068 #endif

Generated at Fri Oct 24 18:11:28 2003 for CTBbase by doxygen1.2.9-20010812 written by Dimitri van Heesch, © 1997-2001