2 * Worldvisions Weaver Software:
3 * Copyright (C) 1997-2002 Net Integration Technologies, Inc.
6 #ifndef __WVCALLBACKLIST_H
7 #define __WVCALLBACKLIST_H
13 template<class InnerCallback
>
17 std::map
<void*, InnerCallback
> list
;
19 /* The idea of copying this gives me a headache. */
20 WvCallbackList(const WvCallbackList
&);
21 WvCallbackList
& operator=(const WvCallbackList
&);
27 void add(const InnerCallback
&cb
, void *cookie
)
29 assert(list
.find(cookie
) == list
.end());
30 list
.insert(std::make_pair(cookie
, cb
));
32 void del(void *cookie
)
34 typename
std::map
<void*, InnerCallback
>::iterator it
=
36 assert(it
!= list
.end());
43 void operator()() const
45 typename
std::map
<void*, InnerCallback
>::const_iterator it
;
47 for (it
= list
.begin(); it
!= list
.end(); ++it
)
51 void operator()(P1
&p1
) const
53 typename
std::map
<void*, InnerCallback
>::const_iterator it
;
55 for (it
= list
.begin(); it
!= list
.end(); ++it
)
60 void operator()(P1
&p1
, P2
&p2
) const
62 typename
std::map
<void*, InnerCallback
>::const_iterator it
;
64 for (it
= list
.begin(); it
!= list
.end(); ++it
)
70 void operator()(P1
&p1
, P2
&p2
, P3
&p3
) const
72 typename
std::map
<void*, InnerCallback
>::const_iterator it
;
74 for (it
= list
.begin(); it
!= list
.end(); ++it
)
75 it
->second(p1
, p2
, p3
);
81 void operator()(P1
&p1
, P2
&p2
, P3
&p3
, P4
&p4
) const
83 typename
std::map
<void*, InnerCallback
>::const_iterator it
;
85 for (it
= list
.begin(); it
!= list
.end(); ++it
)
86 it
->second(p1
, p2
, p3
, p4
);
93 void operator()(P1
&p1
, P2
&p2
, P3
&p3
, P4
&p4
, P5
&p5
) const
95 typename
std::map
<void*, InnerCallback
>::const_iterator it
;
97 for (it
= list
.begin(); it
!= list
.end(); ++it
)
98 it
->second(p1
, p2
, p3
, p4
, p5
);
100 template<typename P1
,
106 void operator()(P1
&p1
, P2
&p2
, P3
&p3
, P4
&p4
, P5
&p5
, P6
&p6
) const
108 typename
std::map
<void*, InnerCallback
>::const_iterator it
;
110 for (it
= list
.begin(); it
!= list
.end(); ++it
)
111 it
->second(p1
, p2
, p3
, p4
, p5
, p6
);
113 template<typename P1
,
120 void operator()(P1
&p1
, P2
&p2
, P3
&p3
, P4
&p4
, P5
&p5
, P6
&p6
,
123 typename
std::map
<void*, InnerCallback
>::const_iterator it
;
125 for (it
= list
.begin(); it
!= list
.end(); ++it
)
126 it
->second(p1
, p2
, p3
, p4
, p5
, p6
, p7
);
128 template<typename P1
,
136 void operator()(P1
&p1
, P2
&p2
, P3
&p3
, P4
&p4
, P5
&p5
, P6
&p6
, P7
&p7
,
139 typename
std::map
<void*, InnerCallback
>::const_iterator it
;
141 for (it
= list
.begin(); it
!= list
.end(); ++it
)
142 it
->second(p1
, p2
, p3
, p4
, p5
, p6
, p7
, p8
);
147 #endif /* __WVCALLBACKLIST_H */