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: 78b0ee419494e05dfe529b8273b5e2393a5b79c3 (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
32
#pragma once

#include "std/cstdint.hpp"

namespace dp
{

class BufferBase
{
public:
  BufferBase(uint8_t elementSize, uint32_t capacity);

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

  uint8_t GetElementSize() const;

  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