]> git.mxchange.org Git - simgear.git/commitdiff
Jenkins has some problems with bind and lambdas. Let's try it with ordinary function...
authorThomas Geymayer <tomgey@gmail.com>
Tue, 6 Nov 2012 18:34:23 +0000 (19:34 +0100)
committerThomas Geymayer <tomgey@gmail.com>
Tue, 6 Nov 2012 18:34:23 +0000 (19:34 +0100)
simgear/canvas/canvas_fwd.hxx
simgear/canvas/elements/CanvasGroup.cxx

index 4c64c1d0087697d2bfab2f6996b4959ba3820de8..802a882761f127cd5176f8a8133624d9117f46ec 100644 (file)
@@ -46,9 +46,9 @@ namespace canvas
   typedef boost::weak_ptr<Element> ElementWeakPtr;
 
   typedef std::map<std::string, const SGPropertyNode*> Style;
-  typedef boost::function<ElementPtr( const CanvasWeakPtr&,
-                                      const SGPropertyNode_ptr&,
-                                      const Style& )> ElementFactory;
+  typedef ElementPtr (*ElementFactory)( const CanvasWeakPtr&,
+                                        const SGPropertyNode_ptr&,
+                                        const Style& );
 
   typedef osg::ref_ptr<osgText::Font> FontPtr;
 
index 89c62a628142bef555e4ab7bc3e3f3c7ea0507e8..375c171fd6545ae01f69b4357f289bde41a8c0ad 100644 (file)
 #include "CanvasPath.hxx"
 #include "CanvasText.hxx"
 
-#include <boost/bind.hpp>
 #include <boost/foreach.hpp>
-#include <boost/make_shared.hpp>
-#include <boost/lambda/core.hpp>
 
 namespace simgear
 {
 namespace canvas
 {
   /**
-   * Create an ElementFactory for elements of type T
+   * Create an canvas Element of type T
    */
   template<typename T>
-  ElementFactory createElementFactory()
+  ElementPtr createElement( const CanvasWeakPtr& canvas,
+                            const SGPropertyNode_ptr& node,
+                            const Style& style )
   {
-    return boost::bind
-    (
-      &boost::make_shared<T, const CanvasWeakPtr&,
-                             const SGPropertyNode_ptr&,
-                             const Style&>,
-      boost::lambda::_1,
-      boost::lambda::_2,
-      boost::lambda::_3
-    );
+    return ElementPtr( new T(canvas, node, style) );
   }
 
   //----------------------------------------------------------------------------
@@ -54,11 +45,11 @@ namespace canvas
                 const Style& parent_style ):
     Element(canvas, node, parent_style)
   {
-    _child_factories["group"] = createElementFactory<Group>();
-    _child_factories["image"] = createElementFactory<Image>();
-    _child_factories["map"  ] = createElementFactory<Map  >();
-    _child_factories["path" ] = createElementFactory<Path >();
-    _child_factories["text" ] = createElementFactory<Text >();
+    _child_factories["group"] = &createElement<Group>;
+    _child_factories["image"] = &createElement<Image>;
+    _child_factories["map"  ] = &createElement<Map  >;
+    _child_factories["path" ] = &createElement<Path >;
+    _child_factories["text" ] = &createElement<Text >;
   }
 
   //----------------------------------------------------------------------------