14 |
|
|
15 |
#include "scene-manager.hpp" |
#include "scene-manager.hpp" |
16 |
#include <map> |
#include <map> |
17 |
|
#include <boost/lambda/bind.hpp> |
18 |
|
#include <boost/lambda/lambda.hpp> |
19 |
namespace |
namespace |
20 |
usata |
usata |
21 |
{ |
{ |
23 |
|
|
24 |
namespace SM_internal |
namespace SM_internal |
25 |
{ |
{ |
26 |
|
|
27 |
|
template <typename P> |
28 |
|
struct FW : public std::unary_function<P,void> |
29 |
|
{ |
30 |
|
void operator()(P t) |
31 |
|
{ |
32 |
|
t.second->draw(); |
33 |
|
} |
34 |
|
}; |
35 |
struct Impl |
struct Impl |
36 |
{ |
{ |
37 |
|
|
41 |
typedef std::map<std::string, Object_sp> ChildrenMap; |
typedef std::map<std::string, Object_sp> ChildrenMap; |
42 |
ChildrenMap children; |
ChildrenMap children; |
43 |
Object* get_ptr(const std::string&); |
Object* get_ptr(const std::string&); |
44 |
|
|
45 |
|
void draw() |
46 |
|
{ |
47 |
|
using namespace ::boost::lambda; |
48 |
|
std::for_each(children.begin(), children.end(), |
49 |
|
FW<ChildrenMap::value_type>()); |
50 |
|
} |
51 |
|
|
52 |
AddStatus add(const Object_sp& obj) |
AddStatus add(const Object_sp& obj) |
53 |
{ |
{ |