MCPcopy Create free account
hub / github.com/comaps/comaps / Get

Method Get

libs/drape/object_pool.hpp:54–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52 }
53
54 T * Get()
55 {
56 std::lock_guard<std::mutex> lock(m_lock);
57 if (m_pool.empty())
58 {
59 T * novice = m_factory.GetNew();
60#if defined(DEBUG) || defined(LOG_OBJECT_POOL)
61 m_checkerSet.insert(novice);
62#endif
63 return novice;
64 }
65 else
66 {
67 T * pt = m_pool.front();
68 m_pool.pop_front();
69 return pt;
70 }
71 }
72
73 void Return(T * object)
74 {

Callers 1

UNIT_TESTFunction · 0.45

Calls 4

frontMethod · 0.80
emptyMethod · 0.45
GetNewMethod · 0.45
insertMethod · 0.45

Tested by 1

UNIT_TESTFunction · 0.36