diff options
Diffstat (limited to 'Tools/AnvilStats/Processor.h')
-rw-r--r-- | Tools/AnvilStats/Processor.h | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/Tools/AnvilStats/Processor.h b/Tools/AnvilStats/Processor.h index 30f160404..426e67d91 100644 --- a/Tools/AnvilStats/Processor.h +++ b/Tools/AnvilStats/Processor.h @@ -1,7 +1,8 @@ // Processor.h -// Interfaces to the cProcessor class representing the overall processor engine that manages threads, calls callbacks etc. +// Interfaces to the cProcessor class representing the overall processor engine that manages threads, calls callbacks +// etc. @@ -23,12 +24,11 @@ class cParsedNBT; class cProcessor { - class cThread : - public cIsThread + class cThread : public cIsThread { typedef cIsThread super; - cCallback & m_Callback; + cCallback & m_Callback; cProcessor & m_ParentProcessor; cEvent m_HasStarted; @@ -37,36 +37,49 @@ class cProcessor void ProcessFile(const AString & a_FileName); void ProcessFileData(const char * a_FileData, size_t a_Size, int a_ChunkBaseX, int a_ChunkBaseZ); - void ProcessChunk(const char * a_FileData, 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 ProcessChunk( + const char * a_FileData, + 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); - // The following processing parts return true if they were interrupted by the callback, causing the processing of current chunk to abort + // The following processing parts return true if they were interrupted by the callback, causing the processing + // of current chunk to abort bool ProcessChunkSections(int a_ChunkX, int a_ChunkZ, cParsedNBT & a_NBT, int a_LevelTag); bool ProcessChunkEntities(int a_ChunkX, int a_ChunkZ, cParsedNBT & a_NBT, int a_LevelTag); bool ProcessChunkTileEntities(int a_ChunkX, int a_ChunkZ, cParsedNBT & a_NBT, int a_LevelTag); bool ProcessChunkTileTicks(int a_ChunkX, int a_ChunkZ, cParsedNBT & a_NBT, int a_LevelTag); - public: + public: cThread(cCallback & a_Callback, cProcessor & a_ParentProcessor); /** Waits until the thread starts processing the callback code. */ void WaitForStart(void); - } ; + }; typedef std::vector<cThread *> cThreads; -public: + public: cProcessor(void); ~cProcessor(); void ProcessWorld(const AString & a_WorldFolder, cCallbackFactory & a_CallbackFactory); -protected: + protected: bool m_IsShuttingDown; // If true, the threads should stop ASAP cCriticalSection m_CS; - AStringList m_FileQueue; + AStringList m_FileQueue; cThreads m_Threads; @@ -76,4 +89,4 @@ protected: /** Returns one filename from m_FileQueue, and removes the name from the queue. */ AString GetOneFileName(void); -} ; +}; |