flext  0.6.0
fldefs_attrcb.h
Go to the documentation of this file.
1 /*
2 flext - C++ layer for Max and Pure Data externals
3 
4 Copyright (c) 2001-2015 Thomas Grill (gr@grrrr.org)
5 For information on usage and redistribution, and for a DISCLAIMER OF ALL
6 WARRANTIES, see the file, "license.txt," in this distribution.
7 */
8 
14 #ifndef __FLEXT_DEFS_ATTRCB_H
15 #define __FLEXT_DEFS_ATTRCB_H
16 
17 
18 
22 #define FLEXT_CALLSET_(FUN,TP) \
23 static bool FLEXT_SET_PRE(FUN)(flext_base *c,TP &arg) \
24 { FLEXT_CAST<thisType *>(c)->FUN(arg); return true; }
25 
29 #define FLEXT_CALLGET_(FUN,TP) \
30 static bool FLEXT_GET_PRE(FUN)(flext_base *c,TP &arg) \
31 { FLEXT_CAST<thisType *>(c)->FUN(arg); return true; }
32 
33 
34 
41 #define FLEXT_CALLSET_F(SFUN) \
42 \
43 FLEXT_CALLSET_(SFUN,float)
44 
46 #define FLEXT_CALLSET_I(SFUN) \
47 \
48 FLEXT_CALLSET_(SFUN,int)
49 
51 #define FLEXT_CALLSET_B(SFUN) \
52 \
53 FLEXT_CALLSET_(SFUN,bool)
54 /*
55 static bool FLEXT_SET_PRE(FUN)(flext_base *c,int &arg) \
56 { bool b = arg != 0; FLEXT_CAST<thisType *>(c)->FUN(b); return true; }
57 */
58 
60 #define FLEXT_CALLSET_E(SFUN,TP) \
61 \
62 FLEXT_CALLSET_(SFUN,TP)
63 
65 #define FLEXT_CALLSET_S(FUN) \
66 static bool FLEXT_SET_PRE(FUN)(flext_base *c,const t_symbol *&arg) \
67 { FLEXT_CAST<thisType *>(c)->FUN(arg); return true; }
68 
70 #define FLEXT_CALLSET_V(FUN) \
71 static bool FLEXT_SET_PRE(FUN)(flext_base *c,flext::AtomList *&arg) \
72 { FLEXT_CAST<thisType *>(c)->FUN(*arg); return true; }
73 
75 
82 #define FLEXT_CALLGET_F(GFUN) \
83 \
84 FLEXT_CALLGET_(GFUN,float)
85 
87 #define FLEXT_CALLGET_I(GFUN) \
88 \
89 FLEXT_CALLGET_(GFUN,int)
90 
92 #define FLEXT_CALLGET_B(GFUN) \
93 \
94 FLEXT_CALLGET_(GFUN,bool)
95 /*
96 static bool FLEXT_GET_PRE(FUN)(flext_base *c,int &arg) \
97 { bool b; FLEXT_CAST<thisType *>(c)->FUN(b); arg = b?1:0; return true; }
98 */
99 
101 #define FLEXT_CALLGET_E(GFUN,TP) \
102 \
103 FLEXT_CALLGET_(GFUN,TP)
104 
106 #define FLEXT_CALLGET_S(FUN) \
107 static bool FLEXT_GET_PRE(FUN)(flext_base *c,const t_symbol *&arg) \
108 { FLEXT_CAST<thisType *>(c)->FUN(arg); return true; }
109 
111 #define FLEXT_CALLGET_V(FUN) \
112 static bool FLEXT_GET_PRE(FUN)(flext_base *c,flext::AtomList *&arg) \
113 { FLEXT_CAST<thisType *>(c)->FUN(*arg); return true; }
114 
116 
117 
124 #define FLEXT_CALLVAR_F(GFUN,SFUN) \
125 \
126 FLEXT_CALLGET_F(GFUN) FLEXT_CALLSET_F(SFUN)
127 
129 #define FLEXT_CALLVAR_I(GFUN,SFUN) \
130 \
131 FLEXT_CALLGET_I(GFUN) FLEXT_CALLSET_I(SFUN)
132 
134 #define FLEXT_CALLVAR_S(GFUN,SFUN) \
135 \
136 FLEXT_CALLGET_S(GFUN) FLEXT_CALLSET_S(SFUN)
137 
139 #define FLEXT_CALLVAR_B(GFUN,SFUN) \
140 \
141 FLEXT_CALLGET_B(GFUN) FLEXT_CALLSET_B(SFUN)
142 
144 #define FLEXT_CALLVAR_E(GFUN,SFUN,TP) \
145 \
146 FLEXT_CALLGET_E(GFUN,TP) FLEXT_CALLSET_E(SFUN,TP)
147 
149 #define FLEXT_CALLVAR_V(GFUN,SFUN) \
150 \
151 FLEXT_CALLGET_V(GFUN) FLEXT_CALLSET_V(SFUN)
152 
154 
155 
156 #endif