Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
SkNamedFactorySet Class Reference

#include <SkPtrRecorder.h>

Inheritance diagram for SkNamedFactorySet:
SkRefCnt SkRefCntBase

Public Member Functions

 SkNamedFactorySet ()
 
uint32_t find (SkFlattenable::Factory)
 
const char * getNextAddedFactoryName ()
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Detailed Description

Similar to SkFactorySet, but only allows Factorys that have registered names. Also has a function to return the next added Factory's name.

Definition at line 146 of file SkPtrRecorder.h.

Constructor & Destructor Documentation

◆ SkNamedFactorySet()

SkNamedFactorySet::SkNamedFactorySet ( )

Definition at line 24 of file SkFlattenable.cpp.

24: fNextAddedFactory(0) {}

Member Function Documentation

◆ find()

uint32_t SkNamedFactorySet::find ( SkFlattenable::Factory  factory)

Find the specified Factory in the set. If it is not already in the set, and has registered its name, add it to the set, and return its index. If the Factory has no registered name, return 0.

Definition at line 26 of file SkFlattenable.cpp.

26 {
27 uint32_t index = fFactorySet.find(factory);
28 if (index > 0) {
29 return index;
30 }
31 const char* name = SkFlattenable::FactoryToName(factory);
32 if (nullptr == name) {
33 return 0;
34 }
35 *fNames.append() = name;
36 return fFactorySet.add(factory);
37}
static const char * FactoryToName(Factory)
T * append()
Definition: SkTDArray.h:191
uint32_t find(T ptr)
uint32_t add(T ptr)
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

◆ getNextAddedFactoryName()

const char * SkNamedFactorySet::getNextAddedFactoryName ( )

If new Factorys have been added to the set, return the name of the first Factory added after the Factory name returned by the last call to this function.

Definition at line 39 of file SkFlattenable.cpp.

39 {
40 if (fNextAddedFactory < fNames.size()) {
41 return fNames[fNextAddedFactory++];
42 }
43 return nullptr;
44}
int size() const
Definition: SkTDArray.h:138

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