Welcome to mirror list, hosted at ThFree Co, Russian Federation.

buffer_base.hpp « drape - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 013cbe68f378275fba5bfd28258057e7da19b794 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once

#include <cstdint>

namespace dp
{
class BufferBase
{
public:
  BufferBase(uint8_t elementSize, uint32_t capacity);
  virtual ~BufferBase() = default;

  uint32_t GetCapacity() const;
  uint32_t GetCurrentSize() const;
  uint32_t GetAvailableSize() const;

  uint8_t GetElementSize() const;

  virtual void Seek(uint32_t elementNumber);

protected:
  void Resize(uint32_t elementCount);
  void UploadData(uint32_t elementCount);
  void SetDataSize(uint32_t elementCount);

private:
  uint8_t m_elementSize;
  uint32_t m_capacity;
  uint32_t m_size;
};
}  // namespace dp