aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source/flattr.cpp
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2003-03-08 04:32:20 +0000
committerThomas Grill <xovo@users.sourceforge.net>2003-03-08 04:32:20 +0000
commit02e2217004783f3c23cef4adc872b8ebb9eaff1d (patch)
treed29f2b16e25d5bafd4ba57ddee3d38f24a0712e1 /externals/grill/flext/source/flattr.cpp
parentf237ae21678a18c8862d4e8c1f180f1d56097b17 (diff)
""
svn path=/trunk/; revision=457
Diffstat (limited to 'externals/grill/flext/source/flattr.cpp')
-rw-r--r--externals/grill/flext/source/flattr.cpp41
1 files changed, 3 insertions, 38 deletions
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