Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | List of all members
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, bool dontneed_safe=false)
 
 ~NonOwnedMapping () override
 
size_t GetSize () const override
 
const uint8_t * GetMapping () const override
 
bool IsDontNeedSafe () const override
 
- Public Member Functions inherited from fml::Mapping
 Mapping ()
 
virtual ~Mapping ()
 
virtual size_t GetSize () const =0
 
virtual const uint8_t * GetMapping () const =0
 
virtual bool IsDontNeedSafe () const =0
 

Detailed Description

Definition at line 115 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 117 of file mapping.h.

Constructor & Destructor Documentation

◆ NonOwnedMapping()

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

Definition at line 91 of file mapping.cc.

95 : data_(data),
96 size_(size),
97 release_proc_(release_proc),
98 dontneed_safe_(dontneed_safe) {}
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ ~NonOwnedMapping()

fml::NonOwnedMapping::~NonOwnedMapping ( )
override

Definition at line 100 of file mapping.cc.

100 {
101 if (release_proc_) {
102 release_proc_(data_, size_);
103 }
104}

Member Function Documentation

◆ GetMapping()

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

Implements fml::Mapping.

Definition at line 110 of file mapping.cc.

110 {
111 return data_;
112}

◆ GetSize()

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

Implements fml::Mapping.

Definition at line 106 of file mapping.cc.

106 {
107 return size_;
108}

◆ IsDontNeedSafe()

bool fml::NonOwnedMapping::IsDontNeedSafe ( ) const
overridevirtual

Implements fml::Mapping.

Definition at line 114 of file mapping.cc.

114 {
115 return dontneed_safe_;
116}

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