[Orxonox-commit 2857] r7560 - code/branches/ois_update/src/libraries/core

rgrieder at orxonox.net rgrieder at orxonox.net
Tue Oct 19 23:22:55 CEST 2010


Author: rgrieder
Date: 2010-10-19 23:22:55 +0200 (Tue, 19 Oct 2010)
New Revision: 7560

Modified:
   code/branches/ois_update/src/libraries/core/BaseObject.h
Log:
De-macro'd a super function declaration in BaseObject.h with the hope of localising a compiler error.

Modified: code/branches/ois_update/src/libraries/core/BaseObject.h
===================================================================
--- code/branches/ois_update/src/libraries/core/BaseObject.h	2010-10-19 21:16:01 UTC (rev 7559)
+++ code/branches/ois_update/src/libraries/core/BaseObject.h	2010-10-19 21:22:55 UTC (rev 7560)
@@ -237,7 +237,41 @@
             bool                                bRegisteredEventStates_; //!< Becomes true after the object registered its event states (with XMLEventPort)
     };
 
-    SUPER_FUNCTION(0, BaseObject, XMLPort, false);
+
+    template <class T, int templatehack2>
+    struct SuperFunctionCondition<0, T, 0, templatehack2>
+    {
+        static void check()
+        {
+            SuperFunctionCondition<0, T, 0, templatehack2>::apply(static_cast<T*>(0));
+            SuperFunctionCondition<0 + 1, T, 0, templatehack2>::check();
+        }
+       
+        static void apply(void* temp) {}
+       
+        static void apply(BaseObject* temp)
+        {
+            ClassIdentifier<T>* identifier = ClassIdentifier<T>::getIdentifier();
+            for (std::set<const Identifier*>::iterator it = identifier->getDirectChildrenIntern().begin(); it != identifier->getDirectChildrenIntern().end(); ++it)
+            {
+                if (((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_XMLPort_isFallback_ && ((ClassIdentifier<T>*)(*it))->superFunctionCaller_XMLPort_)
+                {
+                    delete ((ClassIdentifier<T>*)(*it))->superFunctionCaller_XMLPort_;
+                    ((ClassIdentifier<T>*)(*it))->superFunctionCaller_XMLPort_ = 0;
+                    ((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_XMLPort_isFallback_ = false;
+                }
+               
+                if (!((ClassIdentifier<T>*)(*it))->superFunctionCaller_XMLPort_)
+                {
+                    COUT(5) << "Added SuperFunctionCaller for " << "XMLPort" << ": " << ClassIdentifier<T>::getIdentifier()->getName() << " <- " << ((ClassIdentifier<T>*)(*it))->getName() << std::endl;
+                    ((ClassIdentifier<T>*)(*it))->superFunctionCaller_XMLPort_ = new SuperFunctionClassCaller_XMLPort <T>;
+                }
+            }
+        }
+    };
+
+
+    //SUPER_FUNCTION(0, BaseObject, XMLPort, false);
     SUPER_FUNCTION(2, BaseObject, changedActivity, false);
     SUPER_FUNCTION(3, BaseObject, changedVisibility, false);
     SUPER_FUNCTION(4, BaseObject, XMLEventPort, false);




More information about the Orxonox-commit mailing list