Define the Notify() method on UtilityParser

This commit is contained in:
Eryn Wells 2014-07-15 23:27:24 -07:00
parent d20e4154fe
commit 557d9a047f

View file

@ -70,14 +70,14 @@ private:
/** /**
* UtilityParsers handle small reusable bits of YAML and their constructors take * UtilityParsers handle small reusable bits of YAML. Their constructors take a
* a C++11 lambda, which will be called back with the result of the parsed data. * C++11 lambda, which will be called back with the result of the parsed data.
*/ */
template<typename CallbackType> template<typename T>
struct UtilityParser struct UtilityParser
: public Parser : public Parser
{ {
typedef std::function<CallbackType> CallbackFunction; typedef std::function<void (T)> CallbackFunction;
UtilityParser(Scene& scene, UtilityParser(Scene& scene,
ParserStack& parsers, ParserStack& parsers,
@ -90,6 +90,12 @@ struct UtilityParser
~UtilityParser() ~UtilityParser()
{ } { }
void
Notify(T value)
{
mCallback(value);
}
private: private:
CallbackFunction mCallback; CallbackFunction mCallback;
}; };