From 0556720b559d7ec5d8badacf0ac9b11e9c864847 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Sat, 15 Feb 2014 14:38:24 +0100 Subject: Add ParamModeBase and ParamMode, change all parameter modes to inherit from ParamMode - Type of the extension used to store data is a template parameter - The extension is automatically unset when the mode is unset - Handlers inheriting from ParamMode have to provide OnSet() and SerializeParam(); may optionally provide OnUnset() - Transparently handle the case when OnSet() modifies the mode parameter - Remove Channel::custom_mode_params map; ask the mode handlers to serialize their parameters instead --- include/extensible.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/extensible.h') diff --git a/include/extensible.h b/include/extensible.h index a0544bba1..0e1afdbdf 100644 --- a/include/extensible.h +++ b/include/extensible.h @@ -184,6 +184,7 @@ class CoreExport LocalIntExt : public LocalExtItem std::string serialize(SerializeFormat format, const Extensible* container, void* item) const; intptr_t get(const Extensible* container) const; intptr_t set(Extensible* container, intptr_t value); + void unset(Extensible* container) { set(container, 0); } void free(void* item); }; -- cgit v1.2.3