From: Upinder S. B. <bh...@nc...> - 2006-09-15 02:50:23
|
Hi, Joe, others, We use the Conn* as a handle for the functions that mediate messaging, because we may need to carry extra information in specialized message situations. In those cases we use a derived class from Conn that does something special. In one of the possible recodings of the messaging system, we still would use the Conn because that would give us offset information so we could find the index of the incoming message. There are various other options to think about, including functors and overloading the Element pointer rather than the Conn pointer. I've deferred this refactoring till we have the base code running well enough to get us into alpha. I've found it helps a lot to have a completely running system so we are aware of all the use cases, before trying to rebuild stuff. The getResponse call is not used for messaging, so it doesn't have to dea= l with the above issues. -- Upi --=20 Upinder S. Bhalla National Centre for Biological Sciences, bh...@nc... Tata Institute of Fundamental Research, +91-80-2363-6420X3230 Bellary Road, Fax: +91-80-23636662 Bangalore 560065, INDIA Web: http://www.ncbs.res.in/~bhalla/index.html On Thu, September 14, 2006 11:26 pm, Josef Svitak said: > Why do some functions need a Conn while others need an Element, e.g.: > > void ShellWrapper::setResponse( Conn* c, string value ) { > static_cast< ShellWrapper* >( c->parent() )->response_ =3D value; > } > string ShellWrapper::getResponse( const Element* e ) { > return static_cast< const ShellWrapper* >( e )->response_; > } > > (oooh. and I suppose Conn* could be const in setResponse since we're no= t > changing c, we're changing the Element) > > joe > > Software Engineer > Linux/OSX C/C++/Java > > -----------------------------------------------------------------------= -- > Using Tomcat but need to do more? Need to support web services, securit= y? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geron= imo > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > _______________________________________________ > Moose-g3-devel mailing list > Moo...@li... > https://lists.sourceforge.net/lists/listinfo/moose-g3-devel > |