17#ifndef __ONERT_IR_DATA_H__
18#define __ONERT_IR_DATA_H__
32 virtual size_t size(
void)
const = 0;
33 virtual const uint8_t *
base(
void)
const = 0;
48 size_t size(
void)
const override {
return _size; }
49 const uint8_t *
base(
void)
const override {
return _base; }
65 size_t size(
void)
const override {
return _size; }
66 const uint8_t *
base(
void)
const override {
return _base; }
76 MMapedData(
int fd,
const std::ptrdiff_t mmap_offset,
const size_t mmap_size,
77 const std::ptrdiff_t data_offset,
const size_t data_size)
80 static_cast<uint8_t *>(mmap(NULL, mmap_size, PROT_READ, MAP_PRIVATE, fd, mmap_offset))),
81 _mmap_size(mmap_size), _offset(data_offset - mmap_offset)
91 munmap(
const_cast<uint8_t *
>(_mmap_base), _mmap_size);
96 const uint8_t *
base(
void)
const override {
return _mmap_base + _offset; }
99 const uint8_t *_mmap_base;
101 std::ptrdiff_t _offset;
CachedData(const uint8_t *base, size_t size)
size_t size(void) const override
const uint8_t * base(void) const override
const uint8_t * base(void) const override
size_t size(void) const override
ExternalData(const uint8_t *base, size_t size)
MMapedData(int fd, const std::ptrdiff_t mmap_offset, const size_t mmap_size, const std::ptrdiff_t data_offset, const size_t data_size)
const uint8_t * base(void) const override
virtual size_t size(void) const =0
virtual const uint8_t * base(void) const =0