1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
/*
flext - C++ layer for Max/MSP and pd (pure data) externals
Copyright (c) 2001-2003 Thomas Grill (xovo@gmx.net)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
*/
/*! \file fldefs_attrvar.h
\brief This file contains all #defines for actual usage
*/
#ifndef __FLEXT_DEFS_ATTRVAR_H
#define __FLEXT_DEFS_ATTRVAR_H
/*! \brief Declare an implicite attribute set function
\internal
*/
#define FLEXT_ATTRSET_(VAR,TP) \
static bool FLEXT_SET_PRE(VAR)(flext_base *c,TP &arg) \
{ FLEXT_CAST<thisType *>(c)->VAR = arg; return true; }
/*! \brief Declare an implicite attribute get function
\internal
*/
#define FLEXT_ATTRGET_(VAR,TP) \
static bool FLEXT_GET_PRE(VAR)(flext_base *c,TP &arg) \
{ arg = (TP)FLEXT_CAST<thisType *>(c)->VAR; return true; }
/*! \defgroup FLEXT_DA_ATTRSET Definition of implicite attribute set handlers
@{
*/
//! Declare an implicite set function for a float attribute
#define FLEXT_ATTRSET_F(VAR) \
\
FLEXT_ATTRSET_(VAR,float)
//! Declare an implicite set function for an integer attribute
#define FLEXT_ATTRSET_I(VAR) \
\
FLEXT_ATTRSET_(VAR,int)
//! Declare an implicite set function for a symbol attribute
#define FLEXT_ATTRSET_S(VAR) \
\
FLEXT_ATTRSET_(VAR,t_symptr)
//! Declare an implicite set function for a boolean attribute
#define FLEXT_ATTRSET_B(VAR) \
static bool FLEXT_SET_PRE(VAR)(flext_base *c,int &arg) \
{ FLEXT_CAST<thisType *>(c)->VAR = arg != 0; return true; }
//! Declare an implicite set function for an enum attribute
#define FLEXT_ATTRSET_E(VAR,TP) \
\
FLEXT_ATTRSET_(VAR,TP)
//! Declare an implicite set function for a variable list attribute
#define FLEXT_ATTRSET_V(VAR) \
static bool FLEXT_SET_PRE(VAR)(flext_base *c,AtomList *&arg) \
{ FLEXT_CAST<thisType *>(c)->VAR = *arg; return true; }
//! @} FLEXT_DA_ATTRSET
/*! \defgroup FLEXT_DA_ATTRGET Definition of implicite attribute get handlers
@{
*/
//! Declare an implicite get function for a float attribute
#define FLEXT_ATTRGET_F(VAR) \
\
FLEXT_ATTRGET_(VAR,float)
//! Declare an implicite get function for an integer attribute
#define FLEXT_ATTRGET_I(VAR) \
\
FLEXT_ATTRGET_(VAR,int)
//! Declare an implicite get function for a symbol attribute
#define FLEXT_ATTRGET_S(VAR) \
\
FLEXT_ATTRGET_(VAR,t_symptr)
//! Declare an implicite get function for a boolean attribute
#define FLEXT_ATTRGET_B(VAR) \
static bool FLEXT_GET_PRE(VAR)(flext_base *c,int &arg) \
{ arg = FLEXT_CAST<thisType *>(c)->VAR?1:0; return true; }
//! Declare an implicite get function for an enum attribute
#define FLEXT_ATTRGET_E(VAR,TP) \
\
FLEXT_ATTRGET_(VAR,TP)
//! Declare an implicite get function for a variable list attribute
#define FLEXT_ATTRGET_V(VAR) \
static bool FLEXT_GET_PRE(VAR)(flext_base *c,AtomList *&arg) \
{ *arg = FLEXT_CAST<thisType *>(c)->VAR; return true; }
//! @} FLEXT_DA_ATTRGET
/*! \defgroup FLEXT_DA_ATTRVAR Definition of implicite attribute transfer handlers (both get and set)
@{
*/
//! Declare both implicite get and set functions for a float attribute
#define FLEXT_ATTRVAR_F(VAR) \
\
FLEXT_ATTRGET_F(VAR) FLEXT_ATTRSET_F(VAR)
//! Declare both implicite get and set functions for an integer attribute
#define FLEXT_ATTRVAR_I(VAR) \
\
FLEXT_ATTRGET_I(VAR) FLEXT_ATTRSET_I(VAR)
//! Declare both implicite get and set functions for a symbol attribute
#define FLEXT_ATTRVAR_S(VAR) \
\
FLEXT_ATTRGET_S(VAR) FLEXT_ATTRSET_S(VAR)
//! Declare both implicite get and set functions for a boolean attribute
#define FLEXT_ATTRVAR_B(VAR) \
\
FLEXT_ATTRGET_B(VAR) FLEXT_ATTRSET_B(VAR)
//! Declare both implicite get and set functions for an enum attribute
#define FLEXT_ATTRVAR_E(VAR,TP) \
\
FLEXT_ATTRGET_(VAR,TP) FLEXT_ATTRSET_(VAR,TP)
//! Declare both implicite get and set functions for a variable list attribute
#define FLEXT_ATTRVAR_V(VAR) \
\
FLEXT_ATTRGET_V(VAR) FLEXT_ATTRSET_V(VAR)
//! @} FLEXT_DA_ATTRVAR
#endif
|