1 #ifndef guard_testing_range_checking_hpp
2 #define guard_testing_range_checking_hpp
6 * @brief Specialize the range_checking traits in a manner suitable
9 * @author Carlos O'Ryan
12 #include "tao/Range_Checking_T.h"
18 struct testing_range_checking
22 inline static void check(
26 char const * function_name
)
31 std::ostringstream error
;
32 error
<< "Out of range access in " << function_name
33 << ", index=" << index
34 << ", length=" << length
35 << ", maximum=" << maximum
;
36 throw std::range_error(error
.str());
39 inline static void check_length(
40 CORBA::ULong
& new_length
,
43 if (maximum
< new_length
)
45 std::ostringstream error
;
46 error
<< "Invalid bounded sequence length "
47 << ", length=" << new_length
48 << ", maximum=" << maximum
;
49 throw std::runtime_error(error
.str());
54 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
61 struct range_checking
<T
,true>
62 : public testing_range_checking
<T
>
66 } // namespace details
69 TAO_END_VERSIONED_NAMESPACE_DECL
70 #endif // guard_testing_range_checking_hpp