Commit 5b909580 authored by Thomas Grill's avatar Thomas Grill
Browse files

More fixes for templates

parent 0f6c8ef4
......@@ -609,32 +609,32 @@
08FB77ACFE841707C02AAC07 /* Source */ = {
isa = PBXGroup;
children = (
E99A3DCE0D3592AB00E692EF /* flmap.cpp */,
F55CED7B0383E50201A80AC9 /* flatom_pr.cpp */,
F55CED7C0383E50201A80AC9 /* flatom.cpp */,
F504A66C03CE39F501A80AC9 /* flatom_part.cpp */,
F55CED7B0383E50201A80AC9 /* flatom_pr.cpp */,
F55CED7D0383E50201A80AC9 /* flattr.cpp */,
E9BDCC4104F4D7C1008929A0 /* flattr_ed.cpp */,
F55CED7E0383E50201A80AC9 /* flbase.cpp */,
F598D263044CC4A001A80AC9 /* flbind.cpp */,
F55CED800383E50201A80AC9 /* flbuf.cpp */,
F55CED880383E50201A80AC9 /* fldsp.cpp */,
F55CED8A0383E50201A80AC9 /* flext.cpp */,
F504A66D03CE39F501A80AC9 /* flitem.cpp */,
F55CED8D0383E50201A80AC9 /* fllib.cpp */,
E99A3DCE0D3592AB00E692EF /* flmap.cpp */,
F504A66E03CE39F501A80AC9 /* flmeth.cpp */,
F504A66F03CE39F501A80AC9 /* flmsg.cpp */,
F55CED8F0383E50201A80AC9 /* flout.cpp */,
F55CED900383E50201A80AC9 /* flsndobj.cpp */,
F504A67103CE39F501A80AC9 /* flproxy.cpp */,
F504A67203CE39F501A80AC9 /* flqueue.cpp */,
F598D264044CC4A001A80AC9 /* flsimd.cpp */,
F55CED930383E50201A80AC9 /* flsupport.cpp */,
F55CED950383E50201A80AC9 /* flthr.cpp */,
F5B1FAC8041191190179CFEF /* fltimer.cpp */,
F55CED960383E50201A80AC9 /* flutil.cpp */,
F55CED970383E50201A80AC9 /* flxlet.cpp */,
F504A66C03CE39F501A80AC9 /* flatom_part.cpp */,
F504A66D03CE39F501A80AC9 /* flitem.cpp */,
F504A66E03CE39F501A80AC9 /* flmeth.cpp */,
F504A66F03CE39F501A80AC9 /* flmsg.cpp */,
F504A67103CE39F501A80AC9 /* flproxy.cpp */,
F504A67203CE39F501A80AC9 /* flqueue.cpp */,
F55CED900383E50201A80AC9 /* flsndobj.cpp */,
F504A67303CE39F501A80AC9 /* flstk.cpp */,
F5B1FAC8041191190179CFEF /* fltimer.cpp */,
F598D263044CC4A001A80AC9 /* flbind.cpp */,
F598D264044CC4A001A80AC9 /* flsimd.cpp */,
E9BDCC4104F4D7C1008929A0 /* flattr_ed.cpp */,
);
name = Source;
sourceTree = SOURCE_ROOT;
......
......@@ -15,6 +15,9 @@ $LastChangedBy$
\brief Definitions for handling the t_atom type and lists thereof.
*/
#ifndef __FLEXT_ATOM_CPP
#define __FLEXT_ATOM_CPP
#include "flext.h"
#include <cstring> // for memcpy
......@@ -176,3 +179,6 @@ FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext))::AtomListStaticBase::Free()
}
#include "flpopns.h"
#endif // __FLEXT_ATOM_CPP
......@@ -2,7 +2,7 @@
flext - C++ layer for Max/MSP and pd (pure data) externals
Copyright (c) 2001-2009 Thomas Grill (gr@grrrr.org)
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.
......@@ -15,6 +15,9 @@ $LastChangedBy$
\brief Definitions for handling the t_atom type and lists thereof.
*/
#ifndef __FLEXT_ATOM_PART_CPP
#define __FLEXT_ATOM_PART_CPP
#include "flext.h"
#include "flpushns.h"
......@@ -41,3 +44,6 @@ FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext))::AtomList::GetPart(int offs,int len,A
}
#include "flpopns.h"
#endif // __FLEXT_ATOM_PART_CPP
......@@ -15,6 +15,9 @@ $LastChangedBy$
\brief Definitions for printing and scanning the t_atom type.
*/
#ifndef __FLEXT_ATOM_PR_CPP
#define __FLEXT_ATOM_PR_CPP
#include "flext.h"
#include <cctype>
......@@ -135,3 +138,7 @@ FLEXT_TEMPIMPL(int FLEXT_CLASSDEF(flext))::ScanList(int argc,t_atom *argv,const
}
#include "flpopns.h"
#endif // __FLEXT_ATOM_PR_CPP
......@@ -15,6 +15,9 @@ $LastChangedBy$
\brief Attribute handling for the flext base class
*/
#ifndef __FLEXT_ATTR_CPP
#define __FLEXT_ATTR_CPP
#include "flext.h"
#include <cstring>
......@@ -449,3 +452,7 @@ FLEXT_TEMPIMPL(bool FLEXT_CLASSDEF(flext_base))::ShowAttrib(const t_symbol *attr
}
#include "flpopns.h"
#endif // __FLEXT_ATTR_CPP
......@@ -15,6 +15,9 @@ $LastChangedBy$
\brief Attribute editor (property dialog) for PD
*/
#ifndef __FLEXT_ATTR_ED_CPP
#define __FLEXT_ATTR_ED_CPP
#include "flext.h"
#include "flpushns.h"
......@@ -881,3 +884,6 @@ FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext_base))::cb_GfxSave(flext_hdr *c, t_binb
#include "flpopns.h"
#endif // __FLEXT_ATTR_ED_CPP
......@@ -17,6 +17,9 @@ $LastChangedBy$
\remark This is all derived from GEM by Mark Danks
*/
#ifndef __FLEXT_BASE_CPP
#define __FLEXT_BASE_CPP
#include "flext.h"
#include "flinternal.h"
......@@ -212,3 +215,6 @@ FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext_obj))::GetCanvasDir(char *buf,size_t bu
#include "flpopns.h"
#endif // __FLEXT_BASE_CPP
......@@ -15,6 +15,9 @@ $LastChangedBy$
\brief Functionality for symbol-bound methods.
*/
#ifndef __FLEXT_BIND_CPP
#define __FLEXT_BIND_CPP
#include "flext.h"
#include "flinternal.h"
......@@ -269,3 +272,7 @@ FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext_base))::pxbnd_object::px_method(pxbnd_o
}
#include "flpopns.h"
#endif // __FLEXT_BIND_CPP
......@@ -15,6 +15,9 @@ $LastChangedBy$
\brief Implementation of the buffer abstraction class.
*/
#ifndef __FLEXT_BUF_CPP
#define __FLEXT_BUF_CPP
#include "flext.h"
#include "flfeatures.h"
#include <set>
......@@ -395,3 +398,6 @@ FLEXT_TEMPIMPL(bool FLEXT_CLASSDEF(flext))::buffer::IsDirty() const
#include "flpopns.h"
#endif // __FLEXT_BUF_CPP
......@@ -15,6 +15,9 @@ $LastChangedBy$
\brief Implementation of the flext dsp base class.
*/
#ifndef __FLEXT_DSP_CPP
#define __FLEXT_DSP_CPP
#include "flext.h"
#include "flinternal.h"
#include <cstring>
......@@ -129,3 +132,6 @@ FLEXT_TEMPIMPL(bool FLEXT_CLASSDEF(flext_dsp))::cb_enable(flext_base *b,float &o
#include "flpopns.h"
#endif // __FLEXT_DSP_CPP
......@@ -15,6 +15,9 @@ $LastChangedBy$
\brief Implementation of the flext base class.
*/
#ifndef __FLEXT_CPP
#define __FLEXT_CPP
#include "flext.h"
#include "flinternal.h"
#include "fldsp.h"
......@@ -277,3 +280,7 @@ FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext_base))::cb_dsp(flext_hdr *c,t_signal **
FLEXT_TEMPIMPL(bool FLEXT_CLASSDEF(flext_base))::CbIdle() { return 0; }
#include "flpopns.h"
#endif // __FLEXT_CPP
......@@ -67,4 +67,32 @@ $LastChangedBy$
// include the flext dsp class
#include "fldsp.h"
// include all source code files
#ifdef FLEXT_INLINE
# include "flatom.cpp"
# include "flatom_part.cpp"
# include "flatom_pr.cpp"
# include "flattr.cpp"
# include "flattr_ed.cpp"
# include "flbase.cpp"
# include "flbind.cpp"
# include "flbuf.cpp"
# include "fldsp.cpp"
# include "flext.cpp"
# include "flitem.cpp"
# include "fllib.cpp"
# include "flmap.cpp"
# include "flmeth.cpp"
# include "flmsg.cpp"
# include "flout.cpp"
# include "flproxy.cpp"
# include "flqueue.cpp"
# include "flsimd.cpp"
# include "flsupport.cpp"
# include "flthr.cpp"
# include "fltimer.cpp"
# include "flutil.cpp"
# include "flxlet.cpp"
#endif
#endif // FLEXT_H
......@@ -15,6 +15,9 @@ $LastChangedBy$
\brief Processing of method and attribute lists.
*/
#ifndef __FLEXT_ITEM_CPP
#define __FLEXT_ITEM_CPP
#include "flext.h"
#include <cstring>
......@@ -133,3 +136,6 @@ FLEXT_TEMPIMPL(FLEXT_TEMPSUB(FLEXT_CLASSDEF(flext_base))::ItemCont *FLEXT_CLASSD
#include "flpopns.h"
#endif // __FLEXT_ITEM_CPP
......@@ -15,6 +15,9 @@ $LastChangedBy$
\brief Code for handling of object (and library) creation functions.
*/
#ifndef __FLEXT_LIB_CPP
#define __FLEXT_LIB_CPP
#include "flext.h"
#include "flinternal.h"
......@@ -625,3 +628,6 @@ FLEXT_TEMPIMPL(FLEXT_TEMPSUB(FLEXT_CLASSDEF(flext_base))::ItemCont *FLEXT_CLASSD
FLEXT_TEMPIMPL(FLEXT_TEMPSUB(FLEXT_CLASSDEF(flext_base))::ItemCont *FLEXT_CLASSDEF(flext_base))::ClAttrs(t_classid c) { return &c->attrs; }
#include "flpopns.h"
#endif // __FLEXT_LIB_CPP
......@@ -15,6 +15,9 @@ $LastChangedBy$
\brief flext container classes.
*/
#ifndef __FLEXT_MAP_CPP
#define __FLEXT_MAP_CPP
#include "flext.h"
#include "flmap.h"
......@@ -254,3 +257,4 @@ FLEXT_TEMPIMPL(void TableAnyMap)::iterator::forward()
#include "flpopns.h"
#endif // __FLEXT_MAP_CPP
......@@ -15,6 +15,9 @@ $LastChangedBy$
\brief Method processing of flext base class.
*/
#ifndef __FLEXT_METH_CPP
#define __FLEXT_METH_CPP
#include "flext.h"
#include "flinternal.h"
#include <cstring>
......@@ -137,3 +140,5 @@ FLEXT_TEMPIMPL(bool FLEXT_CLASSDEF(flext_base))::cb_ListMethods(flext_base *c,in
}
#include "flpopns.h"
#endif // __FLEXT_METH_CPP
......@@ -15,6 +15,9 @@ $LastChangedBy$
\brief Message processing of flext base class.
*/
#ifndef __FLEXT_MSG_CPP
#define __FLEXT_MSG_CPP
#include "flext.h"
#include "flpushns.h"
......@@ -305,3 +308,6 @@ FLEXT_TEMPIMPL(bool FLEXT_CLASSDEF(flext_base))::CbMethodResort(int inlet,const
#include "flpopns.h"
#endif // __FLEXT_MSG_CPP
......@@ -15,6 +15,9 @@ $LastChangedBy$
\brief Implementation of the flext outlet functionality.
*/
#ifndef __FLEXT_OUT_CPP
#define __FLEXT_OUT_CPP
#include "flext.h"
#include "flinternal.h"
#include <cstring>
......@@ -371,3 +374,6 @@ FLEXT_TEMPIMPL(bool FLEXT_CLASSDEF(flext_base))::InitOutlets()
#include "flpopns.h"
#endif // __FLEXT_OUT_CPP
......@@ -15,6 +15,9 @@ $LastChangedBy$
\brief Proxy classes for the flext base class.
*/
#ifndef __FLEXT_PROXY_CPP
#define __FLEXT_PROXY_CPP
#include "flext.h"
#include "flinternal.h"
......@@ -241,3 +244,7 @@ FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext_base))::SetProxies(t_class *c,bool dsp)
#endif
#include "flpopns.h"
#endif // __FLEXT_PROXY_CPP
......@@ -19,6 +19,9 @@ $LastChangedBy$
if FLEXT_PDLOCK is defined, the new PD thread lock functions are used
*/
#ifndef __FLEXT_QUEUE_CPP
#define __FLEXT_QUEUE_CPP
#include "flext.h"
#include "flinternal.h"
#include "flcontainers.h"
......@@ -349,7 +352,7 @@ static t_clock *qclk = NULL;
#define CHUNK 10
#if FLEXT_QMODE == 1
static bool QWork(bool syslock,flext_base *flushobj = NULL)
template<typename=void> bool QWork(bool syslock,flext_base *flushobj = NULL)
{
// Since qcnt can only be increased from any other function than QWork
// qc will be a minimum guaranteed number of present queue elements.
......@@ -371,7 +374,7 @@ static bool QWork(bool syslock,flext_base *flushobj = NULL)
}
}
#else
static bool QWork(bool syslock,flext_base *flushobj = NULL)
template<typename=void> bool QWork(bool syslock,flext_base *flushobj = NULL)
{
Queue newmsgs;
flext::MsgBundle *q;
......@@ -418,10 +421,10 @@ static bool QWork(bool syslock,flext_base *flushobj = NULL)
#if FLEXT_QMODE == 0
#if FLEXT_SYS == FLEXT_SYS_JMAX
static void QTick(fts_object_t *c,int winlet, fts_symbol_t s, int ac, const fts_atom_t *at)
template<typename=void> void QTick(fts_object_t *c,int winlet, fts_symbol_t s, int ac, const fts_atom_t *at)
{
#else
static void QTick(flext_base *c)
template<typename=void> void QTick(flext_base *c)
{
#endif
QWork(false);
......@@ -431,7 +434,7 @@ static void QTick(flext_base *c)
# ifndef PERMANENTIDLE
static bool qtickactive = false;
# endif
static t_int QTick(t_int *)
template<typename=void> t_int QTick(t_int *)
{
#ifndef PERMANENTIDLE
qtickactive = false;
......@@ -472,7 +475,7 @@ void Trigger()
qthrcond.Signal();
# elif FLEXT_QMODE == 1 && !defined(PERMANENTIDLE)
if(!qtickactive) {
sys_callback(QTick,NULL,0);
sys_callback(QTick<>,NULL,0);
qtickactive = true;
}
# elif FLEXT_QMODE == 0
......@@ -513,7 +516,7 @@ FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext_base))::StartQueue()
if(qustarted) return;
#if FLEXT_QMODE == 1
# ifdef PERMANENTIDLE
sys_callback(QTick,NULL,0);
sys_callback(QTick<>,NULL,0);
qustarted = true;
# endif
#elif FLEXT_QMODE == 2
......@@ -521,8 +524,8 @@ FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext_base))::StartQueue()
// very unelegant... but waiting should be ok, since happens only on loading
while(!qustarted) Sleep(0.001);
#elif FLEXT_QMODE == 0 && (FLEXT_SYS == FLEXT_SYS_PD || FLEXT_SYS == FLEXT_SYS_MAX)
// qclk = (t_qelem *)(qelem_new(NULL,(t_method)QTick));
qclk = (t_clock *)(clock_new(NULL,(t_method)QTick));
// qclk = (t_qelem *)(qelem_new(NULL,(t_method)QTick<>));
qclk = (t_clock *)(clock_new(NULL,(t_method)QTick<>));
qustarted = true;
#else
# error Not implemented!
......@@ -688,3 +691,6 @@ FLEXT_TEMPIMPL(void FLEXT_CLASSDEF(flext_base))::AddIdle(bool (*idlefun)(int arg
#include "flpopns.h"
#endif // __FLEXT_QUEUE_CPP
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment