Define the Notify() method on UtilityParser
This commit is contained in:
parent
d20e4154fe
commit
557d9a047f
1 changed files with 10 additions and 4 deletions
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue