usata-commits
[Top][All Lists]
Advanced

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

[Usata-commits] Changes to usata2/src/scene-manager.cpp


From: David Lau
Subject: [Usata-commits] Changes to usata2/src/scene-manager.cpp
Date: Sat, 01 Jan 2005 21:52:43 -0500

Index: usata2/src/scene-manager.cpp
diff -u usata2/src/scene-manager.cpp:1.2 usata2/src/scene-manager.cpp:1.3
--- usata2/src/scene-manager.cpp:1.2    Fri Dec 31 07:27:46 2004
+++ usata2/src/scene-manager.cpp        Sun Jan  2 02:41:10 2005
@@ -10,10 +10,12 @@
 // included in the software distribution, or visit
 // http://www.fsf.org/licenses/gpl.html.
 //
-// $Id: scene-manager.cpp,v 1.2 2004/12/31 07:27:46 skunix Exp $
+// $Id: scene-manager.cpp,v 1.3 2005/01/02 02:41:10 skunix Exp $
 
 #include "scene-manager.hpp"
 #include <map>
+#include <boost/lambda/bind.hpp>
+#include <boost/lambda/lambda.hpp>
 namespace
 usata
 {
@@ -21,6 +23,15 @@
 
 namespace SM_internal
 {
+
+template <typename P>
+struct FW : public std::unary_function<P,void>
+{
+       void operator()(P t)
+       {
+               t.second->draw();
+       }
+};
 struct Impl
 {
 
@@ -30,6 +41,13 @@
        typedef std::map<std::string, Object_sp> ChildrenMap;
        ChildrenMap children;
        Object* get_ptr(const std::string&);
+
+       void draw()
+       {
+               using namespace ::boost::lambda;
+               std::for_each(children.begin(), children.end(),
+                               FW<ChildrenMap::value_type>());
+    }
                
        AddStatus add(const Object_sp& obj)
        {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]