Flutter Engine
fml::NonOwnedMapping Class Referencefinal

#include <mapping.h>

Inheritance diagram for fml::NonOwnedMapping:
fml::Mapping

Public Types

using ReleaseProc = std::function< void(const uint8_t *data, size_t size)>
 

Public Member Functions

 NonOwnedMapping (const uint8_t *data, size_t size, const ReleaseProc &release_proc=nullptr)
 
 ~NonOwnedMapping () override
 
size_t GetSize () const override
 
const uint8_t * GetMapping () const override
 
- Public Member Functions inherited from fml::Mapping
 Mapping ()
 
virtual ~Mapping ()
 

Detailed Description

Definition at line 105 of file mapping.h.

Member Typedef Documentation

◆ ReleaseProc

using fml::NonOwnedMapping::ReleaseProc = std::function<void(const uint8_t* data, size_t size)>

Definition at line 107 of file mapping.h.

Constructor & Destructor Documentation

◆ NonOwnedMapping()

fml::NonOwnedMapping::NonOwnedMapping ( const uint8_t *  data,
size_t  size,
const ReleaseProc release_proc = nullptr 
)

Definition at line 86 of file mapping.cc.

89  : data_(data), size_(size), release_proc_(release_proc) {}
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13

◆ ~NonOwnedMapping()

fml::NonOwnedMapping::~NonOwnedMapping ( )
override

Definition at line 91 of file mapping.cc.

91  {
92  if (release_proc_) {
93  release_proc_(data_, size_);
94  }
95 }

Member Function Documentation

◆ GetMapping()

const uint8_t * fml::NonOwnedMapping::GetMapping ( ) const
overridevirtual

Implements fml::Mapping.

Definition at line 101 of file mapping.cc.

101  {
102  return data_;
103 }

◆ GetSize()

size_t fml::NonOwnedMapping::GetSize ( ) const
overridevirtual

Implements fml::Mapping.

Definition at line 97 of file mapping.cc.

97  {
98  return size_;
99 }

The documentation for this class was generated from the following files: