Files
comaps/drape/cpu_buffer.hpp
Konstantin Pastbin e3e4a1985a Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
2025-05-08 21:10:51 +07:00

33 lines
801 B
C++

#pragma once
#include "drape/buffer_base.hpp"
#include <memory>
#include <vector>
namespace dp
{
class CPUBuffer : public BufferBase
{
using TBase = BufferBase;
public:
CPUBuffer(uint8_t elementSize, uint32_t capacity);
~CPUBuffer() override;
void UploadData(void const * data, uint32_t elementCount);
// Set memory cursor on element with number == "elementNumber"
// Element numbers start from 0
void Seek(uint32_t elementNumber) override;
// Check function. In real world use must use it only in assert
uint32_t GetCurrentElementNumber() const;
unsigned char const * Data() const;
private:
unsigned char * NonConstData();
unsigned char * GetCursor() const;
unsigned char * m_memoryCursor;
std::shared_ptr<std::vector<unsigned char>> m_memory;
};
} // namespace dp