Skip to content

Instantly share code, notes, and snippets.

@paulm17
Created March 16, 2015 15:47
Show Gist options
  • Save paulm17/782dfde734d30d1c15c1 to your computer and use it in GitHub Desktop.
Save paulm17/782dfde734d30d1c15c1 to your computer and use it in GitHub Desktop.
template<class T>
ALWAYS_INLINE
static SmartPtr<T> getResource(ObjectData* obj, const char* varName) {
auto var = obj->o_get(varName, true, s_zmqsocket.get());
if (var.getType() == KindOfNull) {
return nullptr;
}
return cast<T>(var);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment