core: const correctness

This commit chanages several functions in renderdoc/core to const functions.
This commit is contained in:
Rasmus Christian Pedersen
2014-05-08 11:01:42 +02:00
parent abd062a700
commit 77ffde4beb
6 changed files with 18 additions and 18 deletions
+2 -2
View File
@@ -372,12 +372,12 @@ ReplayCreateStatus RenderDoc::FillInitParams(const wchar_t *logFile, RDCDriver &
return eReplayCreate_Success;
}
bool RenderDoc::HasReplayDriver(RDCDriver driver)
bool RenderDoc::HasReplayDriver(RDCDriver driver) const
{
return m_ReplayDriverProviders.find(driver) != m_ReplayDriverProviders.end();
}
bool RenderDoc::HasRemoteDriver(RDCDriver driver)
bool RenderDoc::HasRemoteDriver(RDCDriver driver) const
{
if(m_RemoteDriverProviders.find(driver) != m_RemoteDriverProviders.end())
return true;
+8 -8
View File
@@ -145,22 +145,22 @@ class RenderDoc
// set from outside of the device creation interface
void SetLogFile(const wchar_t *logFile);
const wchar_t *GetLogFile() { return m_LogFile.c_str(); }
const wchar_t *GetLogFile() const { return m_LogFile.c_str(); }
const wchar_t *GetCurrentTarget() { return m_Target.c_str(); }
const wchar_t *GetCurrentTarget() const { return m_Target.c_str(); }
void Initialise();
void SetReplayApp(bool replay) { m_Replay = replay; }
bool IsReplayApp() { return m_Replay; }
bool IsReplayApp() const { return m_Replay; }
void BecomeReplayHost(volatile bool &killReplay);
void SetCaptureOptions(const CaptureOptions *opts);
const CaptureOptions &GetCaptureOptions() { return m_Options; }
const CaptureOptions &GetCaptureOptions() const { return m_Options; }
void RecreateCrashHandler();
ICrashHandler *GetCrashHandler() { return m_ExHandler; }
ICrashHandler *GetCrashHandler() const { return m_ExHandler; }
Serialiser *OpenWriteSerialiser(uint32_t frameNum, RDCInitParams *params, void *thpixels, size_t thlen, uint32_t thwidth, uint32_t thheight);
void SuccessfullyWrittenLog();
@@ -191,13 +191,13 @@ class RenderDoc
map<RDCDriver, wstring> GetReplayDrivers();
map<RDCDriver, wstring> GetRemoteDrivers();
bool HasReplayDriver(RDCDriver driver);
bool HasRemoteDriver(RDCDriver driver);
bool HasReplayDriver(RDCDriver driver) const;
bool HasRemoteDriver(RDCDriver driver) const;
void SetCurrentDriver(RDCDriver driver);
void GetCurrentDriver(RDCDriver &driver, wstring &name);
uint32_t GetRemoteAccessIdent() { return m_RemoteIdent; }
uint32_t GetRemoteAccessIdent() const { return m_RemoteIdent; }
void Tick();
+5 -5
View File
@@ -134,10 +134,10 @@ struct ResourceRecord
}
void AddRef() { RefCount++; }
int GetRefCount() { return RefCount; }
int GetRefCount() const { return RefCount; }
void Delete(ResourceRecordHandler *mgr);
ResourceId GetResourceID() { return ResID; }
ResourceId GetResourceID() const { return ResID; }
void AddChunk(Chunk *chunk, int32_t ID = 0)
{
@@ -150,12 +150,12 @@ struct ResourceRecord
void LockChunks() { if(m_ChunkLock) m_ChunkLock->Lock(); }
void UnlockChunks() { if(m_ChunkLock) m_ChunkLock->Unlock(); }
bool HasChunks()
bool HasChunks() const
{
return !m_Chunks.empty();
}
size_t NumChunks()
size_t NumChunks() const
{
return m_Chunks.size();
}
@@ -170,7 +170,7 @@ struct ResourceRecord
UnlockChunks();
}
Chunk *GetLastChunk()
Chunk *GetLastChunk() const
{
RDCASSERT(HasChunks());
return m_Chunks.rbegin()->second;
+1 -1
View File
@@ -68,7 +68,7 @@ void Socket::Shutdown()
}
}
bool Socket::Connected()
bool Socket::Connected() const
{
return (int)socket != -1;
}
+1 -1
View File
@@ -98,7 +98,7 @@ namespace Network
~Socket();
void Shutdown();
bool Connected();
bool Connected() const;
Socket *AcceptClient(bool wait);
+1 -1
View File
@@ -57,7 +57,7 @@ void Socket::Shutdown()
}
}
bool Socket::Connected()
bool Socket::Connected() const
{
return (SOCKET)socket != INVALID_SOCKET;
}