summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/WorldStorage.h
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-02-05 22:45:45 +0100
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-02-05 22:50:18 +0100
commitca6ef58b1ee8521e4b940ee4883dee714960e413 (patch)
tree8532add455224b07c07a759e3d906f50c0695888 /src/WorldStorage/WorldStorage.h
parentMerge pull request #2972 from marvinkopf/PlayerAutoComplete (diff)
downloadcuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.gz
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.bz2
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.lz
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.xz
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.tar.zst
cuberite-ca6ef58b1ee8521e4b940ee4883dee714960e413.zip
Diffstat (limited to 'src/WorldStorage/WorldStorage.h')
-rw-r--r--src/WorldStorage/WorldStorage.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/WorldStorage/WorldStorage.h b/src/WorldStorage/WorldStorage.h
index ab8a7f44b..e171aad43 100644
--- a/src/WorldStorage/WorldStorage.h
+++ b/src/WorldStorage/WorldStorage.h
@@ -37,11 +37,11 @@ class cWSSchema abstract
public:
cWSSchema(cWorld * a_World) : m_World(a_World) {}
virtual ~cWSSchema() {} // Force the descendants' destructors to be virtual
-
+
virtual bool LoadChunk(const cChunkCoords & a_Chunk) = 0;
virtual bool SaveChunk(const cChunkCoords & a_Chunk) = 0;
virtual const AString GetName(void) const = 0;
-
+
protected:
cWorld * m_World;
@@ -58,7 +58,7 @@ class cWorldStorage :
public cIsThread
{
typedef cIsThread super;
-
+
public:
cWorldStorage(void);
@@ -71,16 +71,16 @@ public:
/** Queues a chunk to be saved, asynchronously.
The callback, if specified, will be called with the result of the save operation. */
void QueueSaveChunk(int a_ChunkX, int a_ChunkZ, cChunkCoordCallback * a_Callback = nullptr);
-
+
bool Start(cWorld * a_World, const AString & a_StorageSchemaName, int a_StorageCompressionFactor); // Hide the cIsThread's Start() method, we need to provide args
void Stop(void); // Hide the cIsThread's Stop() method, we need to signal the event
void WaitForFinish(void);
void WaitForLoadQueueEmpty(void);
void WaitForSaveQueueEmpty(void);
-
+
size_t GetLoadQueueLength(void);
size_t GetSaveQueueLength(void);
-
+
protected:
cWorld * m_World;
@@ -88,27 +88,27 @@ protected:
cChunkCoordsQueue m_LoadQueue;
cChunkCoordsQueue m_SaveQueue;
-
+
/** All the storage schemas (all used for loading) */
cWSSchemaList m_Schemas;
-
+
/** The one storage schema used for saving */
cWSSchema * m_SaveSchema;
/** Set when there's any addition to the queues */
cEvent m_Event;
-
+
/** Loads the chunk specified; returns true on success, false on failure */
bool LoadChunk(int a_ChunkX, int a_ChunkZ);
void InitSchemas(int a_StorageCompressionFactor);
-
+
virtual void Execute(void) override;
-
+
/** Loads one chunk from the queue (if any queued); returns true if there are more chunks in the load queue */
bool LoadOneChunk(void);
-
+
/** Saves one chunk from the queue (if any queued); returns true if there are more chunks in the save queue */
bool SaveOneChunk(void);
} ;