MCPcopy Create free account
hub / github.com/WheretIB/nullc / NamespaceSelect

Function NamespaceSelect

NULLC/Callbacks.cpp:198–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196
197template<typename T>
198void NamespaceSelect(InplaceStr name, T& state)
199{
200 for(unsigned i = namespaceStack.size() - 1; i > 0 && state.proceed(); i--)
201 {
202 unsigned hash = namespaceStack[i]->hash;
203 hash = StringHashContinue(hash, ".");
204 if(currNamespace)
205 hash = AddNamespaceToHash(hash, currNamespace);
206 hash = StringHashContinue(hash, name.begin, name.end);
207 state.action(hash);
208 }
209 if(state.proceed())
210 {
211 unsigned int hash = 0;
212 if(NamespaceInfo *ns = currNamespace)
213 {
214 hash = ns->hash;
215 hash = StringHashContinue(hash, ".");
216 hash = StringHashContinue(hash, name.begin, name.end);
217 }else{
218 hash = GetStringHash(name.begin, name.end);
219 }
220 state.action(hash);
221 }
222}
223
224ChunkedStackPool<65532> TypeInfo::typeInfoPool;
225ChunkedStackPool<65532> VariableInfo::variablePool;

Callers 5

SelectTypeByNameFunction · 0.85
SelectVariableByNameFunction · 0.85
AddGetAddressNodeFunction · 0.85
GetCurrentArgumentTypeFunction · 0.85
AddFunctionCallNodeFunction · 0.85

Calls 6

StringHashContinueFunction · 0.85
AddNamespaceToHashFunction · 0.85
GetStringHashFunction · 0.70
sizeMethod · 0.45
proceedMethod · 0.45
actionMethod · 0.45

Tested by

no test coverage detected