From 404bfef9e23dfc3166cb2005367e7e8a41863914 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Thu, 23 Dec 2004 10:07:17 +0000 Subject: base class macros svn path=/trunk/externals/tb/; revision=2426 --- chaos/src/gauss_map.hpp | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) (limited to 'chaos/src/gauss_map.hpp') diff --git a/chaos/src/gauss_map.hpp b/chaos/src/gauss_map.hpp index e2316ec..537dcfb 100644 --- a/chaos/src/gauss_map.hpp +++ b/chaos/src/gauss_map.hpp @@ -33,7 +33,7 @@ public: { m_num_eq = 1; m_data = new data_t[1]; - set_x(0.5); + CHAOS_SYS_INIT(x,0.5); } ~gauss() @@ -51,27 +51,20 @@ public: m_data[0] = fmod(1.f / data); } - void set_x(t_float f) + CHAOS_SYSVAR_FUNCS_PRED(x, 0, m_pred_x); + bool m_pred_x(t_float f) { - if ( (f >= 0) && (f < 1)) - m_data[0] = (data_t) f; - else - post("value for x %f out of range", f); - } - - t_float get_x() - { - return (t_float)m_data[0]; + return (f >= 0) && (f < 1); } - }; -#define GAUSS_CALLBACKS \ -MAP_CALLBACKS; \ -FLEXT_CALLVAR_F(m_system->get_x, m_system->set_x); +#define GAUSS_CALLBACKS \ +MAP_CALLBACKS; \ +CHAOS_SYS_CALLBACKS(x); + +#define GAUSS_ATTRIBUTES \ +MAP_ATTRIBUTES; \ +CHAOS_SYS_ATTRIBUTE(x); -#define GAUSS_ATTRIBUTES \ -MAP_ATTRIBUTES; \ -FLEXT_ADDATTR_VAR("x",m_system->get_x, m_system->set_x); -- cgit v1.2.1