Last change
on this file since 2274 was
2211,
checked in by scheusso, 16 years ago
|
moved some files (Synchronisable, NetworkCallback) to subfolder
synchronisable
|
-
Property svn:eol-style set to
native
-
Property svn:mergeinfo set to
(toggle deleted branches)
/code/branches/ceguilua/src/network/NetworkCallback.h | 1802-1808 | /code/branches/core3/src/network/NetworkCallback.h | 1572-1739 | /code/branches/gcc43/src/network/NetworkCallback.h | 1580 | /code/branches/gui/src/network/NetworkCallback.h | 1635-1723 | /code/branches/input/src/network/NetworkCallback.h | 1629-1636 | /code/branches/objecthierarchy/src/network/NetworkCallback.h | 1911-2085,2100,2110-2169 | /code/branches/pickups/src/network/NetworkCallback.h | 1926-2086 | /code/branches/questsystem/src/network/NetworkCallback.h | 1894-2088 | /code/branches/script_trigger/src/network/NetworkCallback.h | 1295-1953,1955 | /code/branches/weapon/src/network/NetworkCallback.h | 1925-2094 |
|
File size:
625 bytes
|
Line | |
---|
1 | #ifndef _NETWORK_CALLBACK__ |
---|
2 | #define _NETWORK_CALLBACK__ |
---|
3 | |
---|
4 | #include "network/NetworkPrereqs.h" |
---|
5 | |
---|
6 | namespace orxonox{ |
---|
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.