From 5fb315261b6f77b383525d6a0fec4b2bde2f074f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Sun, 24 Jan 2016 22:39:52 +0100 Subject: Work in deva's critique. This branch should now be ready for merge. --- src/memchecker.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/memchecker.h') diff --git a/src/memchecker.h b/src/memchecker.h index c3e13c2..f12c3d2 100644 --- a/src/memchecker.h +++ b/src/memchecker.h @@ -29,20 +29,24 @@ #include "drumkit.h" #include +// includes cstdint automatically and is needed for the PRIu64 macro +#include -class Memchecker +class MemChecker { public: - //! Checks if there is enough memory left to load drumkit into RAM. - //! \param drumkit The drumkit for which it is checked if there's enough memory left. - //! \return True iff there is enough memory left. + //! Checks if there is enough memory left to load drumkit into RAM. + //! \param drumkit The drumkit for which it is checked if there's enough memory left. + //! \return True iff there is enough memory left. bool enoughFreeMemory(const DrumKit& drumkit) const; protected: // Computes how much RAM (in bytes) is left. - size_t calcFreeMemory() const; + uint64_t calcFreeMemory() const; + // Computes how much memory the drumkit takes when loaded into RAM (in bytes). - size_t calcNeededMemory(const DrumKit& drumkit) const; + uint64_t calcNeededMemory(const DrumKit& drumkit) const; + // Computes the number of bytes per channel of using libsnd. - size_t calcBytesPerChannel(const std::string& filename) const; + uint64_t calcBytesPerChannel(const std::string& filename) const; }; -- cgit v1.2.3