00001
00006
00007
00008
00009
00010
00011
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