fldefs_attrvar.h
Go to the documentation of this file.
/*
flext - C++ layer for Max and Pure Data externals
Copyright (c) 2001-2015 Thomas Grill (gr@grrrr.org)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.
*/
#ifndef __FLEXT_DEFS_ATTRVAR_H
#define __FLEXT_DEFS_ATTRVAR_H
#define FLEXT_ATTRSET_(VAR,TP) \
static bool FLEXT_SET_PRE(VAR)(flext_base *c,TP &arg) \
{ FLEXT_CAST<thisType *>(c)->VAR = arg; return true; }
#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; }
#define FLEXT_ATTRSET_F(VAR) \
\
FLEXT_ATTRSET_(VAR,float)
#define FLEXT_ATTRSET_I(VAR) \
\
FLEXT_ATTRSET_(VAR,int)
#define FLEXT_ATTRSET_S(VAR) \
\
FLEXT_ATTRSET_(VAR,const t_symbol *)
#define FLEXT_ATTRSET_B(VAR) \
\
FLEXT_ATTRSET_(VAR,bool)
/*
static bool FLEXT_SET_PRE(VAR)(flext_base *c,int &arg) \
{ FLEXT_CAST<thisType *>(c)->VAR = arg != 0; return true; }
*/
#define FLEXT_ATTRSET_E(VAR,TP) \
\
FLEXT_ATTRSET_(VAR,TP)
#define FLEXT_ATTRSET_V(VAR) \
static bool FLEXT_SET_PRE(VAR)(flext_base *c,flext::AtomList *&arg) \
{ FLEXT_CAST<thisType *>(c)->VAR = *arg; return true; }
#define FLEXT_ATTRGET_F(VAR) \
\
FLEXT_ATTRGET_(VAR,float)
#define FLEXT_ATTRGET_I(VAR) \
\
FLEXT_ATTRGET_(VAR,int)
#define FLEXT_ATTRGET_S(VAR) \
\
FLEXT_ATTRGET_(VAR,const t_symbol *)
#define FLEXT_ATTRGET_B(VAR) \
\
FLEXT_ATTRGET_(VAR,bool)
/*
static bool FLEXT_GET_PRE(VAR)(flext_base *c,int &arg) \
{ arg = FLEXT_CAST<thisType *>(c)->VAR?1:0; return true; }
*/
#define FLEXT_ATTRGET_E(VAR,TP) \
\
FLEXT_ATTRGET_(VAR,TP)
#define FLEXT_ATTRGET_V(VAR) \
static bool FLEXT_GET_PRE(VAR)(flext_base *c,AtomList *&arg) \
{ *arg = FLEXT_CAST<thisType *>(c)->VAR; return true; }
#define FLEXT_ATTRVAR_F(VAR) \
\
FLEXT_ATTRGET_F(VAR) FLEXT_ATTRSET_F(VAR)
#define FLEXT_ATTRVAR_I(VAR) \
\
FLEXT_ATTRGET_I(VAR) FLEXT_ATTRSET_I(VAR)
#define FLEXT_ATTRVAR_S(VAR) \
\
FLEXT_ATTRGET_S(VAR) FLEXT_ATTRSET_S(VAR)
#define FLEXT_ATTRVAR_B(VAR) \
\
FLEXT_ATTRGET_B(VAR) FLEXT_ATTRSET_B(VAR)
#define FLEXT_ATTRVAR_E(VAR,TP) \
\
FLEXT_ATTRGET_(VAR,TP) FLEXT_ATTRSET_(VAR,TP)
#define FLEXT_ATTRVAR_V(VAR) \
\
FLEXT_ATTRGET_V(VAR) FLEXT_ATTRSET_V(VAR)
#endif