include/osg/Callback: nullptr -> NULL

Fixes travis, which explictly requires c++98
This commit is contained in:
Gleb Mazovetskiy 2021-01-14 00:19:02 +00:00 committed by Robert Osfield
parent 417f78ac5e
commit 0161b8ab46

View File

@ -121,6 +121,32 @@ class OSG_EXPORT Callback : public virtual Object {
}
}
/** Convenience method to find a nested callback by type. */
template <typename T>
static T* findNestedCallback(osg::Callback* callback)
{
if (!callback)
return NULL;
if (T* cb = dynamic_cast<T*>(callback))
return cb;
return findNestedCallback<T>(callback->getNestedCallback());
}
/** Convenience method to find a nested callback by type. */
template <typename T>
static const T* findNestedCallback(const osg::Callback* callback)
{
if (!callback)
return NULL;
if (const T* cb = dynamic_cast<const T*>(callback))
return cb;
return findNestedCallback<T>(callback->getNestedCallback());
}
protected:
virtual ~Callback() {}