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