HoverRace  2.0
RecordFile.h
Go to the documentation of this file.
1 
2 // RecordFile.h
3 //
4 // Copyright (c) 2010, 2015 Michael Imamura.
5 //
6 // Licensed under GrokkSoft HoverRace SourceCode License v1.0(the "License");
7 // you may not use this file except in compliance with the License.
8 //
9 // A copy of the license should have been attached to the package from which
10 // you have taken this file. If you can not find the license you can not use
11 // this file.
12 //
13 //
14 // The author makes no representations about the suitability of
15 // this software for any purpose. It is provided "as is" "AS IS",
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17 // implied.
18 //
19 // See the License for the specific language governing permissions
20 // and limitations under the License.
21 
22 #pragma once
23 
24 #include "../Util/Inspectable.h"
25 #include "../Util/OS.h"
26 
27 #include "ObjStream.h"
28 
29 #if defined(_WIN32) && defined(HR_ENGINE_SHARED)
30 # ifdef MR_ENGINE
31 # define MR_DllDeclare __declspec( dllexport )
32 # else
33 # define MR_DllDeclare __declspec( dllimport )
34 # endif
35 #else
36 # define MR_DllDeclare
37 #endif
38 
39 namespace HoverRace {
40 namespace Parcel {
41 
47 {
49 
50 public:
51  RecordFile() : SUPER() { }
52  virtual ~RecordFile() { }
53 
54  virtual bool CreateForWrite(const Util::OS::path_t &filename,
55  MR_UInt32 numRecords, const char *title = nullptr) = 0;
56  virtual bool OpenForWrite(const Util::OS::path_t &filename) = 0;
57  virtual bool OpenForRead(const Util::OS::path_t &filename,
58  bool validateChecksum = false) = 0;
59 
60  // Checksum stuff
61  virtual bool ApplyChecksum(const Util::OS::path_t &filename) = 0;
62 
63  virtual DWORD GetAlignMode() = 0;
64 
65  virtual MR_UInt32 GetNbRecords() const = 0;
66  virtual void SelectRecord(MR_UInt32 i) = 0;
67  virtual bool BeginANewRecord() = 0;
68 
75  virtual ObjStreamPtr StreamIn() = 0;
76 
83  virtual ObjStreamPtr StreamOut() = 0;
84 };
85 
86 } // namespace Parcel
87 } // namespace HoverRace
88 
89 #undef MR_DllDeclare
boost::filesystem::path path_t
Definition: OS.h:57
#define MR_DllDeclare
Definition: RecordFile.h:36
virtual ~RecordFile()
Definition: RecordFile.h:52
Definition: Inspectable.h:41
Base class for parcel implementations.
Definition: RecordFile.h:46
RecordFile()
Definition: RecordFile.h:51
std::shared_ptr< ObjStream > ObjStreamPtr
Definition: ObjStream.h:129
Definition: Announcement.h:24
uint32_t MR_UInt32
Definition: MR_Types.h:44