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 85 of file mapping.cc.

88  : 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 90 of file mapping.cc.

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

Member Function Documentation

◆ GetMapping()

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

Implements fml::Mapping.

Definition at line 100 of file mapping.cc.

100  {
101  return data_;
102 }

◆ GetSize()

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

Implements fml::Mapping.

Definition at line 96 of file mapping.cc.

96  {
97  return size_;
98 }

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