aboutsummaryrefslogtreecommitdiff
path: root/chaos/src/bungalow_tent_map.hpp
diff options
context:
space:
mode:
authorTim Blechmann <timblech@users.sourceforge.net>2004-12-23 10:07:17 +0000
committerIOhannes m zmölnig <zmoelnig@iem.at>2015-10-14 15:11:57 +0200
commit404bfef9e23dfc3166cb2005367e7e8a41863914 (patch)
tree3995ab20cf7ec984560c44e4fdeef1106ce8ff1c /chaos/src/bungalow_tent_map.hpp
parent5233c01a26329306c9f1d08c1a39733aee2cc518 (diff)
base class macros
svn path=/trunk/externals/tb/; revision=2426
Diffstat (limited to 'chaos/src/bungalow_tent_map.hpp')
-rw-r--r--chaos/src/bungalow_tent_map.hpp54
1 files changed, 17 insertions, 37 deletions
diff --git a/chaos/src/bungalow_tent_map.hpp b/chaos/src/bungalow_tent_map.hpp
index 6708eae..dfb6e25 100644
--- a/chaos/src/bungalow_tent_map.hpp
+++ b/chaos/src/bungalow_tent_map.hpp
@@ -37,11 +37,11 @@ class bungalow_tent:
{
public:
bungalow_tent()
- : m_r(0.5)
{
m_num_eq = 1;
m_data = new data_t[1];
- set_x(0.5f);
+ CHAOS_SYS_INIT(x, 0.5);
+ CHAOS_SYS_INIT(r, 0.5);
}
~bungalow_tent()
@@ -52,7 +52,7 @@ public:
virtual void m_step()
{
data_t x = m_data[0];
- data_t r = m_r;
+ data_t r = CHAOS_PARAMETER(r);
if ( x < - 0.5)
{
@@ -77,45 +77,25 @@ public:
}
- void set_x(t_float f)
+ CHAOS_SYSVAR_FUNCS_PRED(x, 0, m_pred_x);
+ bool m_pred_x(t_float f)
{
- if ( (f > -1) && (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];
- }
-
- void set_r(t_float f)
- {
- if ( (f > -.5) && (f < 1))
- m_data[0] = (data_t) f;
- else
- post("value for r %f out of range", f);
+ return (f >= -1) && (f < 1);
}
- t_float get_r()
+ CHAOS_SYSVAR_FUNCS_PRED(r, 0, m_pred_r);
+ bool m_pred_r(t_float f)
{
- return (t_float)m_data[0];
+ return (f >= -0.5) && (f < 1);
}
-
-private:
- data_t m_r;
-
};
+#define BUNGALOW_TENT_CALLBACKS \
+MAP_CALLBACKS; \
+CHAOS_SYS_CALLBACKS(x); \
+CHAOS_SYS_CALLBACKS(r);
-#define BUNGALOW_TENT_CALLBACKS \
-MAP_CALLBACKS; \
-FLEXT_CALLVAR_F(m_system->get_r, m_system->set_r); \
-FLEXT_CALLVAR_F(m_system->get_x, m_system->set_x); \
-
-
-#define BUNGALOW_TENT_ATTRIBUTES \
-MAP_ATTRIBUTES; \
-FLEXT_ADDATTR_VAR("r",m_system->get_r, m_system->set_r); \
-FLEXT_ADDATTR_VAR("x",m_system->get_x, m_system->set_x);
+#define BUNGALOW_TENT_ATTRIBUTES \
+MAP_ATTRIBUTES; \
+CHAOS_SYS_ATTRIBUTE(x) \
+CHAOS_SYS_ATTRIBUTE(r)