[IGSTK-Users] snprintf versus _snprintf

Steve Robbins smr at sumost.ca
Thu Sep 21 14:20:38 EDT 2006


Quoting David Gobbi <dgobbi at atamai.com>:

> Steve Robbins wrote:

>>  /** typedefs for the communication */
>> #ifdef WIN32
>>  typedef SerialCommunicationForWindows                 CommunicationType;
>> #else
>>  typedef SerialCommunicationForPosix                   CommunicationType;
>> #endif
>>
>>
>> will have to be repeated in *every* class that wants to use serial   
>> communications.  It could easily be hidden inside the   
>> igstkSerialCommunication.h header.  One could imagine a factory   
>> method to construct the correct igstkSerialCommunication subclass.
>
> There is an overlying rule for IGSTK, though, that all instantiations
> must be explicit, no factories are allowed.

OK.  But still you can stick the conditional typedef, above, into a  
"system tools"-style header and obtain the code clarity benefit.

> We have considered rolling
> the two SerialCommunication classes together into one class that works
> on both platforms.

Yeah, or do that.

-Steve

P.S. Just out of curiousity: why the ban on factories?





More information about the IGSTK-Users mailing list