[Gridflow-cvs] [svn] commit: r4046 - in /trunk: base/grid.c gridflow.h

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Fri Jul 18 10:07:52 EDT 2008


Author: matju
Date: Fri Jul 18 10:07:52 2008
New Revision: 4046

Log:
GridInlet::sender is now a GridOutlet* instead of a FObject*

Modified:
    trunk/base/grid.c
    trunk/gridflow.h

Modified: trunk/base/grid.c
==============================================================================
--- trunk/base/grid.c (original)
+++ trunk/base/grid.c Fri Jul 18 10:07:52 2008
@@ -110,14 +110,14 @@
 #undef FOO
 }
 
-void GridInlet::begin(GridOutlet *back_out) {
-	nt = back_out->nt;
+void GridInlet::begin(GridOutlet *sender) {
 	if (dim) RAISE("grid inlet aborting from %s at %ld/%ld because of %s",
-			ARGS(sender),long(dex),long(dim->prod()),ARGS(back_out->parent));
-	sender = back_out->parent;
+		ARGS(this->sender->parent),long(dex),long(dim->prod()),ARGS(sender->parent));
+	this->sender = sender;
 	if ((int)nt<0 || (int)nt>=(int)number_type_table_end) RAISE("inlet: unknown number type");
 	if (!supports_type(nt)) RAISE("number type %s not supported here", number_type_table[nt].name);
-	P<Dim> dim = this->dim = back_out->dim;
+	nt = sender->nt;
+	P<Dim> dim = this->dim = sender->dim;
 	dex=0;
 	buf=0;
 	try {
@@ -126,7 +126,7 @@
 #undef FOO
 	} catch (Barf &barf) {this->dim=0; throw;}
 	this->dim = dim;
-	back_out->callback(this);
+	sender->callback(this);
 #ifdef TRACEBUFS
 	post("GridInlet:  %20s buf for recving from %p",dim->to_s(),sender);
 #endif
@@ -140,7 +140,7 @@
 	if (!n) return; // no data
 	long d = dex + bufi;
 	if (d+n > dim->prod()) {
-		post("grid input overflow: %d of %d from [%s] to [%s]", d+n, dim->prod(), ARGS(sender), 0);
+		post("grid input overflow: %d of %d from [%s] to [%s]", d+n, dim->prod(), ARGS(sender->parent), 0);
 		n = dim->prod() - d;
 		if (n<=0) return;
 	}
@@ -171,7 +171,7 @@
 
 void GridInlet::finish() {
 	if (!dim) RAISE("inlet not busy");
-	if (dim->prod() != dex) post("%s: incomplete grid: %d of %d from [%s] to [%s]",ARGS(parent),dex,dim->prod(),ARGS(sender));
+	if (dim->prod() != dex) post("%s: incomplete grid: %d of %d from [%s] to [%s]",ARGS(parent),dex,dim->prod(),ARGS(sender->parent));
 #define FOO(T) try {gh->flow(this,-2,(T *)0);} CATCH_IT;
 	TYPESWITCH(nt,FOO,)
 #undef FOO

Modified: trunk/gridflow.h
==============================================================================
--- trunk/gridflow.h (original)
+++ trunk/gridflow.h Fri Jul 18 10:07:52 2008
@@ -711,7 +711,7 @@
 struct GridInlet : CObject {
 	FObject *parent;
 	const GridHandler *gh;
-	FObject *sender;
+	GridOutlet *sender;
 	P<Dim> dim;
 	NumberTypeE nt;
 	long dex;
@@ -725,7 +725,7 @@
 	void set_chunk(long whichdim);
 	void set_mode(int mode_) {mode=mode_;}
 	int32 factor() {return buf?buf->dim->prod():1;} // which is usually not the same as this->dim->prod(chunk)
-	void begin(GridOutlet *back_out);
+	void begin(GridOutlet *sender);
 	void finish();
 	template <class T> void flow(long n, T *data); // n=-1 is begin, and n=-2 is finish.
 	void from_list(VA, NumberTypeE nt=int32_e) {Grid t(argc,argv,nt); from_grid(&t);}



More information about the Gridflow-cvs mailing list