From 49e661750ceed68ada3f3ae00d6d1620800c1f5f Mon Sep 17 00:00:00 2001 From: Brad Bishop Date: Tue, 23 May 2017 19:16:21 -0400 Subject: Add callback groups Allow named collections of callbacks to be defined and used anywhere callbacks are used. Change-Id: I3224aa06b2250e9a055bc70d20c186caecd033af Signed-off-by: Brad Bishop --- src/templates/callbackgroup.mako.cpp | 2 ++ src/templates/generated.mako.hpp | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 src/templates/callbackgroup.mako.cpp (limited to 'src/templates') diff --git a/src/templates/callbackgroup.mako.cpp b/src/templates/callbackgroup.mako.cpp new file mode 100644 index 0000000..6cc6813 --- /dev/null +++ b/src/templates/callbackgroup.mako.cpp @@ -0,0 +1,2 @@ +std::make_unique>( +${indent(1)}ConfigPropertyCallbackGroups::get()[${c.graph}])\ diff --git a/src/templates/generated.mako.hpp b/src/templates/generated.mako.hpp index 61c2b6f..67b9149 100644 --- a/src/templates/generated.mako.hpp +++ b/src/templates/generated.mako.hpp @@ -128,6 +128,23 @@ struct ConfigPropertyIndicies } }; +struct ConfigPropertyCallbackGroups +{ + using CallbackGroups = std::array, ${len(callbackgroups)}>; + static auto& get() + { + static const CallbackGroups propertyCallbackGraph = + { + { +% for g in callbackgroups: + {${', '.join([str(x) for x in g.members])}}, +% endfor + } + }; + return propertyCallbackGraph; + } +}; + struct ConfigPropertyCallbacks { using Callbacks = std::array, ${len(callbacks)}>; -- cgit v1.2.1