[Gridflow-cvs] [svn] commit: r5881 - /trunk/src/classes2.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Sat Jul 31 17:48:43 EDT 2010


Author: matju
Date: Sat Jul 31 17:48:42 2010
New Revision: 5881

Log:
[gf/propertybang]: support multiple propertybangs per abstraction instance

Modified:
    trunk/src/classes2.cxx

Modified: trunk/src/classes2.cxx
==============================================================================
--- trunk/src/classes2.cxx (original)
+++ trunk/src/classes2.cxx Sat Jul 31 17:48:42 2010
@@ -1659,10 +1659,10 @@
 };
 \end class {install("gridflow",1,1);}
 
-std::map<t_canvas *, t_gobj *> propertybang_map;
+std::map<t_canvas *, std::map<t_gobj *, int> > propertybang_map;
 \class PropertyBang : FObject {
-	\constructor () {propertybang_map[mom] = (t_gobj *)bself;}
-	~PropertyBang () {propertybang_map.erase(mom);}
+	\constructor () {propertybang_map[mom][(t_gobj *)bself]=1;}
+	~PropertyBang () {propertybang_map[mom].erase((t_gobj *)bself);}
 	void properties () {outlet_bang(outlets[0]);}
 };
 extern "C" void canvas_properties(t_gobj *z, t_glist *owner);
@@ -1670,8 +1670,10 @@
 	typeof(propertybang_map.end()) it = propertybang_map.find((t_canvas *)z);
 	if (it == propertybang_map.end()) canvas_properties(z,owner); // fallback
 	else {
-		BFObject *bf = (BFObject *)it->second;
-		((PropertyBang *)bf->self)->properties();
+		foreach(it2,it->second) {
+			BFObject *bf = (BFObject *)it2->first;
+			((PropertyBang *)bf->self)->properties();
+		}
 	}
 }
 \end class {



More information about the Gridflow-cvs mailing list