|
Boost-Commit : |
From: chochlik_at_[hidden]
Date: 2008-06-05 09:15:12
Author: matus.chochlik
Date: 2008-06-05 09:15:12 EDT (Thu, 05 Jun 2008)
New Revision: 46165
URL: http://svn.boost.org/trac/boost/changeset/46165
Log:
added meta-destructors to meta class
Added:
sandbox/mirror/boost/mirror/meta_destructor.hpp (contents, props changed)
Text files modified:
sandbox/mirror/boost/mirror/meta_class.hpp | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
Modified: sandbox/mirror/boost/mirror/meta_class.hpp
==============================================================================
--- sandbox/mirror/boost/mirror/meta_class.hpp (original)
+++ sandbox/mirror/boost/mirror/meta_class.hpp 2008-06-05 09:15:12 EDT (Thu, 05 Jun 2008)
@@ -31,6 +31,9 @@
#include <boost/mirror/traits/reflects_virtual_inheritance.hpp>
// reflection of class member attributes
#include <boost/mirror/meta_attributes.hpp>
+//
+// reflection of destructors
+#include <boost/mirror/meta_destructor.hpp>
namespace boost {
namespace mirror {
@@ -72,6 +75,11 @@
*/
typedef detail::meta_class_all_attributes<Class, VariantTag >
all_attributes;
+
+ /** Meta data concerning the destructor of the reflected class
+ */
+ typedef detail::meta_class_destructor<Class, VariantTag>
+ destructor;
};
Added: sandbox/mirror/boost/mirror/meta_destructor.hpp
==============================================================================
--- (empty file)
+++ sandbox/mirror/boost/mirror/meta_destructor.hpp 2008-06-05 09:15:12 EDT (Thu, 05 Jun 2008)
@@ -0,0 +1,37 @@
+/**
+ * \file boost/mirror/meta_destructor.hpp
+ * Meta data concerning class' destructors
+ *
+ * Copyright 2008 Matus Chochlik. Distributed under the Boost
+ * Software License, Version 1.0. (See accompanying file
+ * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ */
+
+#ifndef BOOST_MIRROR_META_DESTRUCTOR_HPP
+#define BOOST_MIRROR_META_DESTRUCTOR_HPP
+
+
+namespace boost {
+namespace mirror {
+namespace detail {
+
+
+/** Meta class - specializes the meta_type for classes
+ */
+template <
+ class Class,
+ class VariantTag
+>
+struct meta_class_destructor
+{
+ inline static void delete_instance(Class* i){delete i;}
+ inline static void destroy_instance(Class& i){i.~Class();}
+};
+
+
+} // namespace detail
+} // namespace mirror
+} // namespace boost
+
+#endif //include guard
+
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk