summaryrefslogtreecommitdiff
path: root/TAO/tao/Valuetype/Valuetype_Traits_Base_T.h
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/Valuetype/Valuetype_Traits_Base_T.h')
-rw-r--r--TAO/tao/Valuetype/Valuetype_Traits_Base_T.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/TAO/tao/Valuetype/Valuetype_Traits_Base_T.h b/TAO/tao/Valuetype/Valuetype_Traits_Base_T.h
new file mode 100644
index 00000000000..13dfe7ad06d
--- /dev/null
+++ b/TAO/tao/Valuetype/Valuetype_Traits_Base_T.h
@@ -0,0 +1,57 @@
+#ifndef valuetype_traits_base_hpp
+#define valuetype_traits_base_hpp
+/**
+ * @file
+ *
+ * @brief Base class for the valuetype traits.
+ *
+ * $Id$
+ *
+ * @author Carlos O'Ryan
+ */
+
+#include "tao/Objref_VarOut_T.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+namespace details
+{
+
+template<typename object_t, typename object_t_var>
+struct valuetype_traits_base
+{
+ typedef object_t object_type;
+ typedef object_type * value_type;
+ typedef object_type const * const_value_type;
+ typedef object_t_var object_type_var;
+
+ inline static void release(object_type * object)
+ {
+ TAO::Value_Traits<object_type>::remove_ref(object);
+ }
+
+ inline static object_type * duplicate(object_type * object)
+ {
+ TAO::Value_Traits<object_type>::add_ref(object);
+ return object;
+ }
+
+ inline static object_type * nil()
+ {
+ return 0;
+ }
+
+ inline static object_type * default_initializer()
+ {
+ return nil();
+ }
+};
+
+} // namespace details
+} // namespace TAO
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif // valuetype_traits_base_hpp