7 #ifndef PACKAGER_FILE_IO_CACHE_H_
8 #define PACKAGER_FILE_IO_CACHE_H_
12 #include "packager/base/macros.h"
13 #include "packager/base/synchronization/lock.h"
14 #include "packager/base/synchronization/waitable_event.h"
16 namespace edash_packager {
22 explicit IoCache(uint64_t cache_size);
31 uint64_t
Read(
void* buffer, uint64_t size);
40 uint64_t
Write(
const void* buffer, uint64_t size);
61 uint64_t BytesCachedInternal();
62 uint64_t BytesFreeInternal();
64 const uint64_t cache_size_;
66 base::WaitableEvent read_event_;
67 base::WaitableEvent write_event_;
68 std::vector<uint8_t> circular_buffer_;
69 const uint8_t* end_ptr_;
74 DISALLOW_COPY_AND_ASSIGN(
IoCache);
80 #endif // PACKAGER_FILE_IO_CACHE_H