[Ktechlab-devel] code cleanup and connector lists

P Zoltan zoltan.padrah at gmail.com
Mon Dec 22 00:31:03 UTC 2008


   Hi,

  I've investigated the problem a little more and uploaded a possible  
implementation of the FlowConnectorList here:  
http://zotanp.extra.hu/connectorlist.cpp

  That implementation creates the FlowConnectorList compatible with the  
ConnectorList class, but it doesn't achieve this by inheriting from  
ConnectorList, but by defining a cast operator and aggregating two lists  
in the new class: one list of Connectors and the other for FlowConnectors.  
This way the code is less messy. Also note that some methods from the new  
class have complexity O(n), mostly those dealing with iterators. These are  
marked with o(n) comment. In some other methods we could introduce sanity  
check: the 2 lists must contain essentially the same elements, but "seen"  
as different types; these methods are marked with "assert ?" comments.

  Note that this code is (almost) untested, I can only say about it that it  
compiles for me.

  What is your opinion, should I start integrating this code into ktechlab?

  Have a nice vacation,

   Zoltan




More information about the Ktechlab-devel mailing list