MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / insert

Method insert

Source/Misc/luabind/src/inheritance.cpp:204–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202}
203
204void cast_graph::impl::insert(
205 class_id src, class_id target, cast_function cast_)
206{
207 class_id const max_id = std::max(src, target);
208
209 if (max_id >= m_vertices.size())
210 {
211 m_vertices.reserve(max_id + 1);
212 for (class_id i = m_vertices.size(); i < max_id + 1; ++i)
213 m_vertices.push_back(vertex(i));
214 }
215
216 std::vector<edge>& edges = m_vertices[src].edges;
217
218 std::vector<edge>::iterator i = std::lower_bound(
219 edges.begin(), edges.end(), edge(target, 0)
220 );
221
222 if (i == edges.end() || i->target != target)
223 {
224 edges.insert(i, edge(target, cast_));
225 m_cache.invalidate();
226 }
227}
228
229std::pair<void*, int> cast_graph::cast(
230 void* p, class_id src, class_id target

Callers 11

addMatchTargetMethod · 0.45
addMatchTargetSysExMethod · 0.45
updateCacheMethod · 0.45
updateCacheSysExMethod · 0.45
addMatchTargetMethod · 0.45
updateCacheMethod · 0.45
BOOST_FOREACHFunction · 0.45
putMethod · 0.45
allocate_class_idFunction · 0.45
get_localMethod · 0.45
putMethod · 0.45

Calls 7

vertexClass · 0.85
edgeClass · 0.85
reserveMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
invalidateMethod · 0.45

Tested by

no test coverage detected