00001 #ifndef valuetype_traits_base_hpp 00002 #define valuetype_traits_base_hpp 00003 /** 00004 * @file 00005 * 00006 * @brief Base class for the valuetype traits. 00007 * 00008 * $Id: Valuetype_Traits_Base_T.h 88803 2010-02-02 11:13:27Z vzykov $ 00009 * 00010 * @author Carlos O'Ryan 00011 */ 00012 00013 #include "tao/Valuetype/Value_VarOut_T.h" 00014 00015 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00016 00017 namespace TAO 00018 { 00019 namespace details 00020 { 00021 00022 template<typename object_t, typename object_t_var> 00023 struct valuetype_traits_base 00024 { 00025 typedef object_t object_type; 00026 typedef object_type * value_type; 00027 typedef object_type const * const_value_type; 00028 typedef object_t_var object_type_var; 00029 00030 inline static void release(object_type * object) 00031 { 00032 TAO::Value_Traits<object_type>::remove_ref(object); 00033 } 00034 00035 inline static object_type * duplicate(object_type * object) 00036 { 00037 TAO::Value_Traits<object_type>::add_ref(object); 00038 return object; 00039 } 00040 00041 inline static object_type * nil() 00042 { 00043 return 0; 00044 } 00045 00046 inline static object_type * default_initializer() 00047 { 00048 return nil(); 00049 } 00050 }; 00051 00052 } // namespace details 00053 } // namespace TAO 00054 00055 TAO_END_VERSIONED_NAMESPACE_DECL 00056 00057 #endif // valuetype_traits_base_hpp