Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/network/src/network/Synchronisable.h @ 237

Last change on this file since 237 was 237, checked in by scheusso, 16 years ago

synchronisable

File size: 1.1 KB
Line 
1//
2// C++ Interface: synchronisable
3//
4// Description:
5//
6//
7// Author:  Oliver Scheuss, (C) 2007
8//
9// Copyright: See COPYING file that comes with this distribution
10//
11//
12#ifndef NETWORKSYNCHRONISABLE_H
13#define NETWORKSYNCHRONISABLE_H
14
15#include <list>
16
17namespace network {
18
19 
20struct syncData{
21  int length;
22  int classID;
23  int objectID;
24  unsigned char *data;
25};
26
27typedef struct synchronisableVariable{
28  int size;
29  const void *var;
30}SYNCVAR;
31
32 
33/**
34 * This class is the base class of all the Objects in the universe that need to be synchronised over the network
35 * Every class, that inherits from this class has to link the DATA THAT NEEDS TO BE SYNCHRONISED into the linked list. Additionally it also has to provide a Constructor, that takes exactly the variables in this linked list.
36 * @author Oliver Scheuss
37*/
38class Synchronisable{
39public:
40  Synchronisable();
41
42  ~Synchronisable();
43  int objectID;
44  int classID;
45   
46  void registerVar(const void *var, int size);
47  syncData getData();
48  bool updateData(syncData vars);
49  virtual void registerAllVariables();
50
51private:
52  std::list<SYNCVAR> syncList;
53};
54
55}
56
57#endif
Note: See TracBrowser for help on using the repository browser.