MCPcopy Create free account
hub / github.com/axmolengine/axmol / getObject

Method getObject

extensions/fairygui/src/fairygui/GObjectPool.cpp:16–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14}
15
16GObject* GObjectPool::getObject(const std::string & url)
17{
18 std::string url2 = UIPackage::normalizeURL(url);
19 if (url2.length() == 0)
20 return nullptr;
21
22 GObject* ret;
23 Vector<GObject*>& arr = _pool[url2];
24 if (!arr.empty())
25 {
26 ret = arr.back();
27 ret->retain();
28 arr.popBack();
29 ret->autorelease();
30 }
31 else
32 ret = UIPackage::createObjectFromURL(url2);
33 return ret;
34}
35
36void GObjectPool::returnObject(GObject* obj)
37{

Callers 10

createCellMethod · 0.45
getFromPoolMethod · 0.45
handleScroll1Method · 0.45
handleScroll2Method · 0.45
handleScroll3Method · 0.45
createCommonMethod · 0.45
createButtonMethod · 0.45
createInputMethod · 0.45
createSelectMethod · 0.45

Calls 6

popBackMethod · 0.80
autoreleaseMethod · 0.80
lengthMethod · 0.45
emptyMethod · 0.45
backMethod · 0.45
retainMethod · 0.45

Tested by

no test coverage detected