From 02e2217004783f3c23cef4adc872b8ebb9eaff1d Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Sat, 8 Mar 2003 04:32:20 +0000 Subject: "" svn path=/trunk/; revision=457 --- externals/grill/flext/source/flattr.cpp | 41 +++------------------------------ 1 file changed, 3 insertions(+), 38 deletions(-) (limited to 'externals/grill/flext/source/flattr.cpp') diff --git a/externals/grill/flext/source/flattr.cpp b/externals/grill/flext/source/flattr.cpp index f55fe0ee..8b5ede86 100644 --- a/externals/grill/flext/source/flattr.cpp +++ b/externals/grill/flext/source/flattr.cpp @@ -31,23 +31,6 @@ flext_base::attritem::~attritem() // if(nxt) delete nxt; } -/* -void flext_base::AddAttrItem(attritem *m) -{ - int ix = m->Hash(); - post("attr index %x",ix); - attritem *&aix = attrhead[ix]; - - if(aix) { - attritem *mi; - for(mi = aix; mi->nxt; mi = mi->nxt) {} - mi->nxt = m; - } - else - aix = m; -// m->th->attrcnt++; -} -*/ //! Add get and set attributes void flext_base::AddAttrib(itemarr *aa,itemarr *ma,const char *attr,metharg tp,methfun gfun,methfun sfun) @@ -153,8 +136,11 @@ bool flext_base::ListAttrib() flext_base::attritem *flext_base::FindAttr(const t_symbol *tag,bool get) const { + // first search within object scope attritem *a = (attritem *)attrhead->Find(tag); while(a && (a->tag != tag || a->inlet != 0 || (get?a->IsSet():a->IsGet()))) a = (attritem *)a->nxt; + + // then (if nothing found) search within class scope if(!a) { a = (attritem *)clattrhead->Find(tag); while(a && (a->tag != tag || a->inlet != 0 || (get?a->IsSet():a->IsGet()))) a = (attritem *)a->nxt; @@ -219,27 +205,6 @@ bool flext_base::SetAttrib(attritem *a,int argc,const t_atom *argv) return true; } -/* -bool flext_base::GetAttrib(const t_symbol *tag) -{ - if(argc) - post("%s - %s: arguments ignored",thisName(),GetString(tag)); - -#ifdef FLEXT_DEBUG - if(strncmp(GetString(tag),"get",3)) { - post("%s - %s: tag has no 'get' prefix",thisName(),GetString(tag)); - return false; - } -#endif - - const t_symbol *mtag = MakeSymbol(GetString(a->tag)+3); - - // search for attribute - attritem *a = (attritem *)attrhead->Find(mtag); - if(!a) a = (attritem *)clattrhead->Find(mtag); -} -*/ - bool flext_base::GetAttrib(attritem *a) { // main attribute tag -- cgit v1.2.1