[glibmm] gmmproc: _CLASS_GOBJECT(): Move operations: Call interfaces' move operations.



commit bc51ad82a6ff879caac2534b29a913cf2d023c33
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Aug 21 22:15:04 2015 +0200

    gmmproc: _CLASS_GOBJECT(): Move operations: Call interfaces' move operations.
    
    The (virtual base) ObjectBase's move operations will not be called
    multiple times, so this might be useless, but it seems more complete.

 tools/m4/base.m4          |    2 ++
 tools/m4/class_gobject.m4 |    2 ++
 tools/m4/class_shared.m4  |   16 ++++++++++++++++
 3 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/tools/m4/base.m4 b/tools/m4/base.m4
index 2824026..6734b2a 100644
--- a/tools/m4/base.m4
+++ b/tools/m4/base.m4
@@ -179,6 +179,8 @@ _NEW_SECTION(SECTION_CLASS2)      dnl  _CLASS to end of class
 _NEW_SECTION(SECTION_CC)   dnl  section for methods (in current namespace)
 
 _NEW_SECTION(SECTION_CC_IMPLEMENTS_INTERFACES)   dnl Calls SomeBaseInterface::add_interface(get_type()).
+_NEW_SECTION(SECTION_CC_MOVE_CONSTRUCTOR_INTERFACES)   dnl Calls the base constructors
+_NEW_SECTION(SECTION_CC_MOVE_ASSIGNMENT_OPERATOR_INTERFACES)   dnl Calls the base move assignment operator
 
 dnl Virtual Functions and Default Signal Handlers (Very similar)
 _NEW_SECTION(SECTION_H_VFUNCS)      dnl Declaration of vfunc hooks.
diff --git a/tools/m4/class_gobject.m4 b/tools/m4/class_gobject.m4
index b769c29..f80ce90 100644
--- a/tools/m4/class_gobject.m4
+++ b/tools/m4/class_gobject.m4
@@ -213,11 +213,13 @@ __CPPNAME__::__CPPNAME__`'(__CNAME__* castitem)
 
 __CPPNAME__::__CPPNAME__`'(__CPPNAME__&& src)
 : __CPPPARENT__`'(std::move(src))
+_IMPORT(SECTION_CC_MOVE_CONSTRUCTOR_INTERFACES)
 {}
 
 __CPPNAME__& __CPPNAME__::operator=(__CPPNAME__&& src)
 {
   __CPPPARENT__::operator=`'(std::move(src));
+_IMPORT(SECTION_CC_MOVE_ASSIGNMENT_OPERATOR_INTERFACES)
   return *this;
 }
 
diff --git a/tools/m4/class_shared.m4 b/tools/m4/class_shared.m4
index 3442ad1..7a3e0fb 100644
--- a/tools/m4/class_shared.m4
+++ b/tools/m4/class_shared.m4
@@ -39,6 +39,22 @@ ifelse(`$2',,,`
 #endif // $2
 ')dnl
 _POP()
+_PUSH(SECTION_CC_MOVE_CONSTRUCTOR_INTERFACES)
+ifelse(`$2',,,`#ifdef $2'
+)dnl
+  , $1`'(std::move(src))
+ifelse(`$2',,,`
+#endif // $2
+')dnl
+_POP()
+_PUSH(SECTION_CC_MOVE_ASSIGNMENT_OPERATOR_INTERFACES)
+ifelse(`$2',,,`#ifdef $2'
+)dnl
+  $1`'::operator=(std::move(src));
+ifelse(`$2',,,`
+#endif // $2
+')dnl
+_POP()
 ')
 
 dnl GVolumeMonitor can be broken/impeded by defining a sub-type.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]