diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-09-27 22:02:25 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-09-27 22:02:25 +0200 |
commit | 6ccc4e36743485c50c58ec0f43d08181ba20958a (patch) | |
tree | 09de7f83dda7b2d856de21caaf2b25e73a15f45e /AnvilStats/Processor.h | |
parent | Made Anvil the default storage schema (diff) | |
download | cuberite-6ccc4e36743485c50c58ec0f43d08181ba20958a.tar cuberite-6ccc4e36743485c50c58ec0f43d08181ba20958a.tar.gz cuberite-6ccc4e36743485c50c58ec0f43d08181ba20958a.tar.bz2 cuberite-6ccc4e36743485c50c58ec0f43d08181ba20958a.tar.lz cuberite-6ccc4e36743485c50c58ec0f43d08181ba20958a.tar.xz cuberite-6ccc4e36743485c50c58ec0f43d08181ba20958a.tar.zst cuberite-6ccc4e36743485c50c58ec0f43d08181ba20958a.zip |
Diffstat (limited to 'AnvilStats/Processor.h')
-rw-r--r-- | AnvilStats/Processor.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/AnvilStats/Processor.h b/AnvilStats/Processor.h new file mode 100644 index 000000000..300185e67 --- /dev/null +++ b/AnvilStats/Processor.h @@ -0,0 +1,70 @@ +
+// Processor.h
+
+// Interfaces to the cProcessor class representing the overall processor engine that manages threads, calls callbacks etc.
+
+
+
+
+#pragma once
+
+
+
+
+
+// fwd:
+class cCallback;
+class cCallbackFactory;
+class cParsedNBT;
+
+
+
+
+
+class cProcessor
+{
+ class cThread :
+ public cIsThread
+ {
+ typedef cIsThread super;
+
+ cCallback & m_Callback;
+ cProcessor & m_ParentProcessor;
+
+ // cIsThread override:
+ virtual void Execute(void) override;
+
+ void ProcessFile(const AString & a_FileName);
+ void ProcessChunk(cFile & a_File, int a_ChunkX, int a_ChunkZ, unsigned a_SectorStart, unsigned a_SectorSize, unsigned a_TimeStamp);
+ void ProcessCompressedChunkData(int a_ChunkX, int a_ChunkZ, const char * a_CompressedData, int a_CompressedSize);
+ void ProcessParsedChunkData(int a_ChunkX, int a_ChunkZ, cParsedNBT & a_NBT);
+ bool ProcessChunkSections(int a_ChunkX, int a_ChunkZ, cParsedNBT & a_NBT, int a_LevelTag);
+
+ public:
+ cThread(cCallback & a_Callback, cProcessor & a_ParentProcessor);
+ } ;
+
+ typedef std::vector<cThread *> cThreads;
+
+public:
+ cProcessor(void);
+ ~cProcessor();
+
+ void ProcessWorld(const AString & a_WorldFolder, cCallbackFactory & a_CallbackFactory);
+
+protected:
+ bool m_IsShuttingDown; // If true, the threads should stop ASAP
+
+ cCriticalSection m_CS;
+ AStringList m_FileQueue;
+
+ cThreads m_Threads;
+
+ void PopulateFileQueue(const AString & a_WorldFolder);
+
+ AString GetOneFileName(void);
+} ;
+
+
+
+
|