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

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Mon Jul 14 12:40:53 EDT 2008


Author: matju
Date: Mon Jul 14 12:40:52 2008
New Revision: 4022

Log:
add GridInlet::chunk

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

Modified: trunk/base/grid.c
==============================================================================
--- trunk/base/grid.c (original)
+++ trunk/base/grid.c Mon Jul 14 12:40:52 2008
@@ -107,6 +107,7 @@
 // afterwards. This is to allow some optimisations. Anyway there is no good reason
 // why this would be changed afterwards.
 void GridInlet::set_chunk(long whichdim) {
+	chunk = whichdim;
 	long n = dim->prod(whichdim);
 	if (!n) n=1;
 	if(!dim) RAISE("huh?");
@@ -245,6 +246,7 @@
 	int32 v = (MAX_PACKET_SIZE/lcm_factor)*lcm_factor;
 	if (v==0) v=MAX_PACKET_SIZE; // factor too big. don't have a choice.
 	buf=new Grid(new Dim(v),nt);
+	//post("GridOutlet: made buf of size %s",dim->to_s());
 }
 
 // send modifies dex; send_direct doesn't

Modified: trunk/gridflow.h
==============================================================================
--- trunk/gridflow.h (original)
+++ trunk/gridflow.h Mon Jul 14 12:40:52 2008
@@ -718,17 +718,18 @@
 	P<Dim> dim;
 	NumberTypeE nt;
 	long dex;
+	int chunk;
 private:
 	PtrGrid buf;// factor-chunk buffer
 	long bufi;   // buffer index: how much of buf is filled
 public:
 	int mode; // 0=ignore; 4=ro
 	GridInlet(FObject *parent_, const GridHandler *gh_) :
-		parent(parent_), gh(gh_), sender(0), dim(0), nt(int32_e), dex(0), bufi(0), mode(4) {}
+		parent(parent_), gh(gh_), sender(0), dim(0), nt(int32_e), dex(0), chunk(-1), bufi(0), mode(4) {}
 	~GridInlet() {}
 	void set_chunk(long whichdim);
 	void set_mode(int mode_) {mode=mode_;}
-	int32 factor() {return buf?buf->dim->prod():1;}
+	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 finish(); /* i thought this should be private but maybe it shouldn't. */
 



More information about the Gridflow-cvs mailing list