gramods
SyncData.hh
1 
2 #ifndef GRAMODS_NETWORK_SYNCDATA
3 #define GRAMODS_NETWORK_SYNCDATA
4 
5 #include <gmNetwork/config.hh>
6 
7 #include <vector>
8 #include <memory>
9 
10 BEGIN_NAMESPACE_GMNETWORK;
11 
12 class DataSync;
13 
17 class SyncData {
18 
19 public:
20 
21  SyncData();
22 
23 protected:
24 
29  void pushValue();
30 
31  virtual void encode(std::vector<char> &d) = 0;
32  virtual void decode(std::vector<char> d) = 0;
33 
34  virtual void update() = 0;
35 
36 private:
37 
38  void setSynchronizer(std::shared_ptr<DataSync> sync);
39 
40  friend DataSync;
41 
42 private:
43 
44  struct Impl;
45  std::shared_ptr<Impl> _impl;
46 
47 };
48 
49 END_NAMESPACE_GMNETWORK;
50 
51 #endif
Synchronization of simple data, such as boolean, float or integer values, over network.
Definition: DataSync.hh:70
Simple synchronizeable data container.
Definition: SyncData.hh:17
Definition: SyncData.cpp:11