Emergency 20 Dokumentation  4.2.0
DataRecorder.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Header guard ]
6 //[-------------------------------------------------------]
7 #pragma once
8 
9 
10 //[-------------------------------------------------------]
11 //[ Includes ]
12 //[-------------------------------------------------------]
13 #include "em5/Export.h"
14 
15 #include <boost/noncopyable.hpp>
16 
17 #include <iosfwd> // For the forward declarations of iostreams
18 #include <memory> // For std::unique_ptr
19 #include <string>
20 
21 
22 //[-------------------------------------------------------]
23 //[ Forward declarations ]
24 //[-------------------------------------------------------]
25 namespace qsf
26 {
27  class Time;
28  namespace game
29  {
30  class BitStream;
31  }
32 }
33 
34 
35 //[-------------------------------------------------------]
36 //[ Namespace ]
37 //[-------------------------------------------------------]
38 namespace em5
39 {
40  namespace multiplayer
41  {
42 
43 
44  //[-------------------------------------------------------]
45  //[ Classes ]
46  //[-------------------------------------------------------]
51  class EM5_API_EXPORT DataRecorder : public boost::noncopyable
52  {
53 
54 
55  //[-------------------------------------------------------]
56  //[ Public methods ]
57  //[-------------------------------------------------------]
58  public:
66  explicit DataRecorder(const std::string& fileName);
67 
72  virtual ~DataRecorder();
73 
84  void recordData(const qsf::Time& timePassedSinceStart, const qsf::game::BitStream& bitStream);
85 
86 
87  //[-------------------------------------------------------]
88  //[ Private data ]
89  //[-------------------------------------------------------]
90  private:
91  std::unique_ptr<std::ostream> mRecorderStream;
92  std::string mFilename;
93  };
94 
95 
96 //[-------------------------------------------------------]
97 //[ Namespace ]
98 //[-------------------------------------------------------]
99  } // multiplayer
100 } // em5
Definition: ActionPriority.h:13
#define EM5_API_EXPORT
Definition: Export.h:28
EMERGENCY 5 multiplayer data recorder. Records any data which the host/client would send to the clien...
Definition: DataRecorder.h:51
Game bit stream class (just a wrapper for linnet bit stream)
Definition: BitStream.h:40
Definition: PickupPersonByParamedicAction.h:21
Data type for encapsulating time information. It might represents points in time and time spans...
Definition: Time.h:32