flext 0.6.2
fldefs_attrcb.h
Go to the documentation of this file.
1/*
2flext - C++ layer for Max and Pure Data externals
3
4Copyright (c) 2001-2015 Thomas Grill (gr@grrrr.org)
5For information on usage and redistribution, and for a DISCLAIMER OF ALL
6WARRANTIES, 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) \
23static 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) \
30static 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\
43FLEXT_CALLSET_(SFUN,float)
44
46#define FLEXT_CALLSET_I(SFUN) \
47\
48FLEXT_CALLSET_(SFUN,int)
49
51#define FLEXT_CALLSET_B(SFUN) \
52\
53FLEXT_CALLSET_(SFUN,bool)
54/*
55static 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\
62FLEXT_CALLSET_(SFUN,TP)
63
65#define FLEXT_CALLSET_S(FUN) \
66static 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) \
71static 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\
84FLEXT_CALLGET_(GFUN,float)
85
87#define FLEXT_CALLGET_I(GFUN) \
88\
89FLEXT_CALLGET_(GFUN,int)
90
92#define FLEXT_CALLGET_B(GFUN) \
93\
94FLEXT_CALLGET_(GFUN,bool)
95/*
96static 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\
103FLEXT_CALLGET_(GFUN,TP)
104
106#define FLEXT_CALLGET_S(FUN) \
107static 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) \
112static 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\
126FLEXT_CALLGET_F(GFUN) FLEXT_CALLSET_F(SFUN)
127
129#define FLEXT_CALLVAR_I(GFUN,SFUN) \
130\
131FLEXT_CALLGET_I(GFUN) FLEXT_CALLSET_I(SFUN)
132
134#define FLEXT_CALLVAR_S(GFUN,SFUN) \
135\
136FLEXT_CALLGET_S(GFUN) FLEXT_CALLSET_S(SFUN)
137
139#define FLEXT_CALLVAR_B(GFUN,SFUN) \
140\
141FLEXT_CALLGET_B(GFUN) FLEXT_CALLSET_B(SFUN)
142
144#define FLEXT_CALLVAR_E(GFUN,SFUN,TP) \
145\
146FLEXT_CALLGET_E(GFUN,TP) FLEXT_CALLSET_E(SFUN,TP)
147
149#define FLEXT_CALLVAR_V(GFUN,SFUN) \
150\
151FLEXT_CALLGET_V(GFUN) FLEXT_CALLSET_V(SFUN)
152
154
155
156#endif