[gme-users] second template argument for aggregated getter for setmembers?

Zoltan Molnar zolmol at isis.vanderbilt.edu
Mon May 22 15:51:01 CDT 2006


Thanks for pointing out this issue. I fixed it.

Zoli

> -----Original Message-----
> From: gme-users-bounces at list.isis.vanderbilt.edu 
> [mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf 
> Of Ace Thompson
> Sent: Friday, May 19, 2006 4:52 PM
> To: gme-users
> Subject: [gme-users] second template argument for aggregated 
> getter for setmembers?
> 
> 
> Hi,
> 
> I apologize if this has come up before (I did try to find a 
> related message in the maillinglist archives but couldn't find one.)
> 
> When using the BON Extender Interpreter, and choosing the 
> "template method" option for generating getters, it seems 
> that the generated code isn't quite right for <<Set>> 
> elements with respect to the template parameter used to sort 
> the std::set<> that will contain the contained elements when 
> you get them. 
> 
> For example, suppose I have a <<Model>> named M and a <<Set>> 
> named S in my model. Suppose they both "contain" an element 
> named F.  (obviously the containment is "model containment" 
> for M, and "set containment" for S)
> 
> The interpreter generates the following "getter" for M to get "F":
> 
> 	template <class T>
> 	std::set<F, T>		getF (TDP)
> 	{
> 		std::set<F, T> res;
> 		std::set<BON::FCO> roles = getChildFCOsAs("F");
> 		for( std::set<BON::FCO>::iterator i = 
> roles.begin(); i != roles.end(); ++i)
> 		{
> 			F elem(*i);
> 			ASSERT(elem);
> 			res.insert(elem);
> 		}
> 		return res;
> 	}
> 
> The "getter" for S is slightly different:
> 
> 	template <class T>
> 	std::set<F>		getF( int dummy, TDP)
> 	{
> 		std::set<F> res;
> 		std::set<BON::FCO> elems = BON::SetImpl::getMembers();
> 		std::set<BON::FCO>::iterator elem = elems.begin();
> 		for( ; elem != elems.end(); ++elem)
> 		{
> 			F r( *elem);
> 			if ( r)
> 				res.insert( r);
> 		}
> 		return res;
> 	}
> 
> Notice that in the second case the template parameter "T" 
> isn't used.  The workaround is to hand-jam it in there after 
> you generate the code, which isn't a big deal but I'm 
> guessing either this wasn't the intent or there's an 
> extraneous template parameter on the method definition...
> 
> This is with GME 5.9.21 and uhm I'm not sure what version of 
> the BON Extender Interpreter but if that is relevant I can 
> figure that out...
> 
> Thanks,
> ____________
> Ace Thompson
> Ignite Analytics Corporation
> acethompson at igniteweb.net
> m. 480 703 8909
> 
> 
> 
> _______________________________________________
> gme-users mailing list
> gme-users at list.isis.vanderbilt.edu
> http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users
> 


More information about the gme-users mailing list