aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2005-03-16 04:56:38 +0000
committerThomas Grill <xovo@users.sourceforge.net>2005-03-16 04:56:38 +0000
commit4d4f8d07f3341e8309c1b066263a40227664bc3d (patch)
treeb54c8807e28f73f83b5704c3f91d0fc012c98f83 /externals/grill/flext/source
parent31a2d9dcc2b3a519033918e180f81c4e7b9f8e7e (diff)
static method map
minor other things fixes for OSX fix for gcc svn path=/trunk/; revision=2629
Diffstat (limited to 'externals/grill/flext/source')
-rw-r--r--externals/grill/flext/source/flclass.h6
-rw-r--r--externals/grill/flext/source/flext.cpp4
-rw-r--r--externals/grill/flext/source/flmap.h32
-rwxr-xr-xexternals/grill/flext/source/flmeth.cpp7
-rwxr-xr-xexternals/grill/flext/source/flmsg.cpp6
-rw-r--r--externals/grill/flext/source/flsupport.h3
6 files changed, 29 insertions, 29 deletions
diff --git a/externals/grill/flext/source/flclass.h b/externals/grill/flext/source/flclass.h
index 06c48927..351a0bcb 100644
--- a/externals/grill/flext/source/flclass.h
+++ b/externals/grill/flext/source/flclass.h
@@ -664,7 +664,7 @@ protected:
/*! This class holds hashed item entries
\note not thread-safe!
*/
- class ItemCont
+ class FLEXT_SHARE ItemCont
{
public:
ItemCont();
@@ -821,7 +821,7 @@ public:
//! @} FLEXT_CLASS
- ItemCont *ThMeths() { return methhead; }
+ ItemCont *ThMeths() { return &methhead; }
static ItemCont *ClMeths(t_classid c) { return GetClassArr(c,0); }
static void AddMethod(ItemCont *ma,int inlet,const t_symbol *tag,methfun fun,metharg tp,...);
@@ -870,7 +870,7 @@ private:
static ItemCont *GetClassArr(t_classid,int ix);
- mutable ItemCont *methhead,*clmethhead;
+ mutable ItemCont methhead,*clmethhead;
mutable ItemCont *bindhead;
bool CallMeth(const MethItem &m,int argc,const t_atom *argv);
diff --git a/externals/grill/flext/source/flext.cpp b/externals/grill/flext/source/flext.cpp
index 531109f8..c4fa81c4 100644
--- a/externals/grill/flext/source/flext.cpp
+++ b/externals/grill/flext/source/flext.cpp
@@ -38,7 +38,6 @@ flext_base::FLEXT_CLASSDEF(flext_base)():
t_classid clid = thisClassId();
clmethhead = ClMeths(clid);
- methhead = new ItemCont;
bindhead = NULL;
if(procattr) {
@@ -62,7 +61,7 @@ flext_base::~FLEXT_CLASSDEF(flext_base)()
#if FLEXT_SYS == FLEXT_SYS_MAX
// according to David Z. one should do that first...
- if(insigs) dsp_free(thisHdr());
+ if(insigs) dsp_free(thisHdr());
// if(insigs) dsp_freebox(thisHdr());
#endif
@@ -74,7 +73,6 @@ flext_base::~FLEXT_CLASSDEF(flext_base)()
QFlush(this);
// delete message lists
- if(methhead) delete methhead;
if(bindhead) delete bindhead; // ATTENTION: the object must free all memory associated to bindings itself
if(attrhead) delete attrhead;
if(attrdata) delete attrdata;
diff --git a/externals/grill/flext/source/flmap.h b/externals/grill/flext/source/flmap.h
index 8ad3a864..7355a7ff 100644
--- a/externals/grill/flext/source/flmap.h
+++ b/externals/grill/flext/source/flmap.h
@@ -15,6 +15,8 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#ifndef __FLMAP_H
#define __FLMAP_H
+#include "flprefix.h"
+
/*! \defgroup FLEXT_SUPPORT Flext support classes
@{
*/
@@ -78,7 +80,7 @@ public:
#endif
-class TableAnyMap
+class FLEXT_SHARE TableAnyMap
{
protected:
virtual TableAnyMap *New(TableAnyMap *parent) = 0;
@@ -101,18 +103,18 @@ protected:
int size() const;
- inline void insert(size_t k,void *t)
+ void insert(size_t k,void *t)
{
FLEXT_ASSERT(t);
if(n) _set(k,t);
else data[n++](k,t);
}
- inline void *find(size_t k) { return n?_find(k):NULL; }
+ void *find(size_t k) { return n?_find(k):NULL; }
void clear();
- inline void _toleft(size_t k,void *t)
+ void _toleft(size_t k,void *t)
{
if(left)
left->_set(k,t);
@@ -123,7 +125,7 @@ protected:
}
}
- inline void _toright(size_t k,void *t)
+ void _toright(size_t k,void *t)
{
if(right)
right->_set(k,t);
@@ -134,8 +136,8 @@ protected:
}
}
- inline void _toleft(Data &v) { _toleft(v.key,v.value); }
- inline void _toright(Data &v) { _toright(v.key,v.value); }
+ void _toleft(Data &v) { _toleft(v.key,v.value); }
+ void _toright(Data &v) { _toright(v.key,v.value); }
void _set(size_t k,void *t);
void *_find(size_t k);
@@ -150,9 +152,9 @@ protected:
class iterator
{
public:
- inline iterator(): map(NULL) {}
- inline iterator(TableAnyMap &m): map(&m),ix(0) { leftmost(); }
- inline iterator(iterator &it): map(it.map),ix(it.ix) {}
+ iterator(): map(NULL) {}
+ iterator(TableAnyMap &m): map(&m),ix(0) { leftmost(); }
+ iterator(iterator &it): map(it.map),ix(it.ix) {}
iterator &operator =(const iterator &it) { map = it.map,ix = it.ix; return *this; }
@@ -181,7 +183,7 @@ protected:
template <typename K,typename T,int N = 8,bool O = false>
-class TableMap
+class FLEXT_SHARE TableMap
: TableAnyMap
{
public:
@@ -200,9 +202,9 @@ public:
: TableAnyMap::iterator
{
public:
- inline iterator() {}
- inline iterator(TableMap &m): TableAnyMap::iterator(m) {}
- inline iterator(iterator &it): TableAnyMap::iterator(it) {}
+ iterator() {}
+ iterator(TableMap &m): TableAnyMap::iterator(m) {}
+ iterator(iterator &it): TableAnyMap::iterator(it) {}
inline iterator &operator =(const iterator &it) { TableAnyMap::operator =(it); return *this; }
@@ -215,7 +217,7 @@ public:
};
protected:
- inline TableMap(TableAnyMap *p): TableAnyMap(p,N,slots,O) {}
+ TableMap(TableAnyMap *p): TableAnyMap(p,N,slots,O) {}
virtual TableAnyMap *New(TableAnyMap *parent) { return new TableMap(parent); }
virtual void Free(void *ptr) { delete (T *)ptr; }
diff --git a/externals/grill/flext/source/flmeth.cpp b/externals/grill/flext/source/flmeth.cpp
index a9bf6749..e93db27a 100755
--- a/externals/grill/flext/source/flmeth.cpp
+++ b/externals/grill/flext/source/flmeth.cpp
@@ -17,9 +17,6 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#include <stdarg.h>
#include "flinternal.h"
-#include <set>
-
-
flext_base::MethItem::MethItem(AttrItem *conn):
Item(conn),index(0),
argc(0),args(NULL)
@@ -41,7 +38,7 @@ void flext_base::MethItem::SetArgs(methfun _fun,int _argc,metharg *_args)
void flext_base::AddMethodDef(int inlet,const t_symbol *tag)
{
- methhead->Add(new MethItem,tag,inlet);
+ methhead.Add(new MethItem,tag,inlet);
}
/*! \brief Add a method to the queue
@@ -97,7 +94,7 @@ void flext_base::ListMethods(AtomList &la,int inlet) const
int i;
for(i = 0; i <= 1; ++i) {
- ItemCont *a = i?methhead:clmethhead;
+ ItemCont *a = i?&methhead:clmethhead;
if(a && a->Contained(inlet)) {
ItemSet &ai = a->GetInlet(inlet);
for(ItemSet::iterator as(ai); as; ++as) {
diff --git a/externals/grill/flext/source/flmsg.cpp b/externals/grill/flext/source/flmsg.cpp
index 5a8ef0b1..b31ddc41 100755
--- a/externals/grill/flext/source/flmsg.cpp
+++ b/externals/grill/flext/source/flmsg.cpp
@@ -140,17 +140,17 @@ bool flext_base::FindMeth(int inlet,const t_symbol *s,int argc,const t_atom *arg
Item *lst;
// search for exactly matching tag
- if((lst = methhead->FindList(s,inlet)) != NULL && TryMethTag(lst,s,argc,argv)) return true;
+ if((lst = methhead.FindList(s,inlet)) != NULL && TryMethTag(lst,s,argc,argv)) return true;
if((lst = clmethhead->FindList(s,inlet)) != NULL && TryMethTag(lst,s,argc,argv)) return true;
// if no list args, then search for pure symbol
if(!argc) {
- if((lst = methhead->FindList(sym_symbol,inlet)) != NULL && TryMethSym(lst,s)) return true;
+ if((lst = methhead.FindList(sym_symbol,inlet)) != NULL && TryMethSym(lst,s)) return true;
if((lst = clmethhead->FindList(sym_symbol,inlet)) != NULL && TryMethSym(lst,s)) return true;
}
// otherwise search for anything
- if((lst = methhead->FindList(sym_anything,inlet)) != NULL && TryMethAny(lst,s,argc,argv)) return true;
+ if((lst = methhead.FindList(sym_anything,inlet)) != NULL && TryMethAny(lst,s,argc,argv)) return true;
if((lst = clmethhead->FindList(sym_anything,inlet)) != NULL && TryMethAny(lst,s,argc,argv)) return true;
// if nothing found try any inlet
diff --git a/externals/grill/flext/source/flsupport.h b/externals/grill/flext/source/flsupport.h
index 7aef0c85..2491c035 100644
--- a/externals/grill/flext/source/flsupport.h
+++ b/externals/grill/flext/source/flsupport.h
@@ -646,6 +646,9 @@ public:
AtomListStatic(int argc,const t_atom *argv = NULL): AtomListStaticBase(PRE,pre) { operator()(argc,argv); }
//! Construct list
AtomListStatic(const AtomList &a): AtomListStaticBase(PRE,pre) { operator =(a); }
+
+ //! Set list by another AtomList
+ AtomListStatic &operator =(const AtomListStatic &a) { AtomListStaticBase::operator =(a); return *this; }
protected:
t_atom pre[PRE];
};