#ifndef guard_testing_string_traits_hpp #define guard_testing_string_traits_hpp /** * @file * * @brief Specialize the string traits so they can be used in testing. * * $Id$ * * @author Carlos O'Ryan */ #include "testing_exception.hpp" #include "string_traits.hpp" #include "testing_counters.hpp" template struct testing_string_traits : public TAO::details::string_traits_base , public TAO::details::string_traits_decorator > { static call_counter default_initializer_calls; static call_counter duplicate_calls; static call_counter release_calls; static call_counter not_released_from_const_calls; static call_counter not_released_from_managed_calls; typedef charT char_type; typedef TAO::details::string_traits real_traits; static char_type * default_initializer() { default_initializer_calls(); return real_traits::default_initializer(); } static char_type * duplicate(char_type const * s) { duplicate_calls(); return real_traits::duplicate(s); } static void release(char_type * s) { release_calls(); return real_traits::release(s); } static void not_released_from_const( char_type * & dst, char_type const * src) { not_released_from_const_calls(); real_traits::not_released_from_const(dst, src); } static void not_released_from_managed( char_type * & dst, char_type const * src) { not_released_from_managed_calls(); real_traits::not_released_from_managed(dst, src); } }; template call_counter testing_string_traits::default_initializer_calls; template call_counter testing_string_traits::duplicate_calls; template call_counter testing_string_traits::release_calls; template call_counter testing_string_traits::not_released_from_const_calls; template call_counter testing_string_traits::not_released_from_managed_calls; namespace TAO { namespace details { template<> struct string_traits : public testing_string_traits { }; template<> struct string_traits : public testing_string_traits { }; } // namespace details } // namespace TAO #endif // guard_testing_string_traits_hpp