Last change
on this file since 2302 was
2087,
checked in by landauf, 16 years ago
|
merged objecthierarchy branch back to trunk
|
-
Property svn:eol-style set to
native
|
File size:
617 bytes
|
Line | |
---|
1 | #ifndef _NETWORK_CALLBACK__ |
---|
2 | #define _NETWORK_CALLBACK__ |
---|
3 | |
---|
4 | #include "NetworkPrereqs.h" |
---|
5 | |
---|
6 | namespace network{ |
---|
7 | class _NetworkExport NetworkCallbackBase |
---|
8 | { |
---|
9 | public: |
---|
10 | virtual void call() = 0; |
---|
11 | virtual ~NetworkCallbackBase() {} |
---|
12 | }; |
---|
13 | |
---|
14 | template <class T> |
---|
15 | class NetworkCallback: public NetworkCallbackBase |
---|
16 | { |
---|
17 | public: |
---|
18 | NetworkCallback(T* object, void (T::*function) (void)) : object_(object), function_(function) {} |
---|
19 | virtual ~NetworkCallback() {} |
---|
20 | virtual void call() |
---|
21 | { (this->object_->*function_)(); } |
---|
22 | |
---|
23 | private: |
---|
24 | T* object_; |
---|
25 | void (T::*function_) (void); |
---|
26 | }; |
---|
27 | |
---|
28 | |
---|
29 | } |
---|
30 | |
---|
31 | |
---|
32 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.