Merge pull request #2303 from jwillemsen/jwi-803
[ACE_TAO.git] / TAO / tests / Sequence_Unit_Tests / testing_object_reference_traits.hpp
blob072945c61306b83127e294c77c0eac97099b8cc0
1 #ifndef guard_testing_object_reference_traits_hpp
2 #define guard_testing_object_reference_traits_hpp
3 /**
4 * @file
6 * @brief Specialize the object reference traits so they can be used
7 * in testing.
9 * @author Carlos O'Ryan
12 #include "testing_exception.hpp"
13 #include "testing_counters.hpp"
14 #include "tao/Object_Reference_Traits_T.h"
16 template<typename object_t, typename object_t_var>
17 struct testing_object_reference_traits
18 : public TAO::details::object_reference_traits_base<object_t, object_t_var>
19 , public TAO::details::object_reference_traits_decorator<object_t, object_t_var, testing_object_reference_traits<object_t, object_t_var> >
21 static call_counter default_initializer_calls;
22 static call_counter duplicate_calls;
23 static call_counter release_calls;
25 typedef object_t object_type;
26 typedef object_t_var object_type_var;
27 typedef TAO::details::object_reference_traits<object_t,object_t_var,false> real_traits;
29 static object_type * default_initializer()
31 default_initializer_calls();
32 return real_traits::default_initializer();
35 static object_type * duplicate(object_type * s)
37 duplicate_calls();
38 return real_traits::duplicate(s);
41 static void release(object_type * s)
43 release_calls();
44 real_traits::release(s);
48 template<typename object_t,typename object_t_var> call_counter
49 testing_object_reference_traits<object_t,object_t_var>::default_initializer_calls;
51 template<typename object_t,typename object_t_var> call_counter
52 testing_object_reference_traits<object_t,object_t_var>::duplicate_calls;
54 template<typename object_t,typename object_t_var> call_counter
55 testing_object_reference_traits<object_t,object_t_var>::release_calls;
57 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
58 namespace TAO
60 namespace details
63 template<typename object_t, typename object_t_var>
64 struct object_reference_traits<object_t,object_t_var,true>
65 : public testing_object_reference_traits<object_t,object_t_var>
69 } // namespace details
70 } // namespace TAO
71 TAO_END_VERSIONED_NAMESPACE_DECL
73 #endif // guard_testing_object_reference_traits_hpp