summaryrefslogtreecommitdiff
path: root/src/mbgl/text/glyph_pbf.hpp
blob: e0f65e7789ccceeba3730d1ea088c1a804030fae (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
33
34
35
36
37
38
39
40
41
42
43
#ifndef MBGL_TEXT_GLYPH_PBF
#define MBGL_TEXT_GLYPH_PBF

#include <mbgl/text/glyph.hpp>
#include <mbgl/text/glyph_store.hpp>
#include <mbgl/util/noncopyable.hpp>

#include <atomic>
#include <functional>
#include <string>
#include <memory>

namespace mbgl {

class FontStack;
class FileRequest;

class GlyphPBF : private util::noncopyable {
public:
    GlyphPBF(GlyphStore* store,
             const std::string& fontStack,
             const GlyphRange&,
             GlyphStore::Observer*);
    ~GlyphPBF();

    bool isParsed() const {
        return parsed;
    }

private:
    void parse(GlyphStore*, const std::string& fontStack, const GlyphRange&);

    std::shared_ptr<const std::string> data;
    std::atomic<bool> parsed;

    std::unique_ptr<FileRequest> req;

    GlyphStore::Observer* observer = nullptr;
};

} // namespace mbgl

#endif