Last change
on this file since 6413 was
5997,
checked in by patrick, 19 years ago
|
merged the network branche a second time because there where some more changes in the code: svn merge -r5991:HEAD branches/network trunk
|
File size:
1.1 KB
|
Line | |
---|
1 | /*! |
---|
2 | * @file connection_monitor.h |
---|
3 | \brief interface for all classes that have to be synchronized |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _SYNCHRONIZEABLE_H |
---|
7 | #define _SYNCHRONIZEABLE_H |
---|
8 | |
---|
9 | #include "base_object.h" |
---|
10 | #include "netdefs.h" |
---|
11 | |
---|
12 | |
---|
13 | |
---|
14 | #include <vector> |
---|
15 | #include <list> |
---|
16 | |
---|
17 | //State constants: They have to be of the form 2^n |
---|
18 | #define STATE_SERVER 1 |
---|
19 | #define STATE_OUTOFSYNC 2 |
---|
20 | |
---|
21 | |
---|
22 | class Synchronizeable : virtual public BaseObject |
---|
23 | { |
---|
24 | public: |
---|
25 | |
---|
26 | Synchronizeable(const char* name); |
---|
27 | Synchronizeable(); |
---|
28 | ~Synchronizeable(); |
---|
29 | |
---|
30 | virtual void writeBytes(const byte* data, int length); |
---|
31 | virtual int readBytes(byte* data); |
---|
32 | virtual void writeDebug() const; |
---|
33 | virtual void readDebug() const; |
---|
34 | |
---|
35 | |
---|
36 | |
---|
37 | |
---|
38 | |
---|
39 | void setIsServer(bool isServer); |
---|
40 | void setIsOutOfSync(bool outOfSync); |
---|
41 | bool isServer(); |
---|
42 | bool isOutOfSync(); |
---|
43 | |
---|
44 | private: |
---|
45 | |
---|
46 | int uniqueID; |
---|
47 | |
---|
48 | |
---|
49 | |
---|
50 | //static std::vector<Synchronizeable*> classList; |
---|
51 | int owner; |
---|
52 | int hostID; |
---|
53 | int state; |
---|
54 | std::list<int> synchronizeRequests; |
---|
55 | |
---|
56 | }; |
---|
57 | #endif /* _SYNCHRONIZEABLE_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.