On Tue, 30 Jul 2013, Phil Dibowitz wrote: >> Yes, but I think if I added a virtual function at the CRemote level, I >> would have to add a non-virtual function in all of the CRemote >> subclasses, not just CRemoteMH. We could do that, but we would just have >> useless empty implementations in each of the subclasses, so I'm not sure >> if that's better. > > We do this in quite a few places. I think it's cleaner than casting, and also > more consistent.
I'll do whatever you want, but I would argue that casting is cleaner. (I could probably do the casting a little cleaner, by using dynamic_cast and checking the result.) In this case, we're knowingly performing an operation that only a subtype of CRemote can perform, so we cast the CRemote to a CRemoteMH. If we went the other way, we'd be adding dummy operations to each subclass of CRemote that don't do anything, just because one subclass can. I think of it like this: just because some cars have 4 doors, doesn't mean that we have to give all cars 4 doors, but for "2-door" cars only 2 of the doors work. If I am knowingly dealing with a 4-door car, I can check whether it is really one, and then attempt to open the back door, rather than just blindly attempt to open the back door on a car, where if it is a 2-door, that just won't do anything. :-) >From a consistency standpoint, yes, we've done that in the past. But I think we've also casted in a few places. >> Well, when I added the #define for LINK_TIMEOUT, I was going to use >> LINK_TIMEOUT in all of the places where I needed to extend the timeout to >> wait for the Link. Well, it turns out that it was only needed in that one >> place. > > Sure, I figured that out. Do you have a guess as to why? My *guess* would be > that if you're configuring wifi, once you're done writing the config file, it > waits until it manages to associate, authenticate, and get an address... > before replying. Do you know if it's true if you're not updating wifi > settings? > > Or conversely, perhaps wifi is faster, but when you update the harmony > username/password info, then it tries to download a connectivity test and > such, and that's what takes a while? > > I'm curious if you have any insight. > > Even if you don't, we should probably re-word the comment when we #define > LINK_TIMEOUT to explain that this is a timeout just for the last write to a > LINK when writing a file... Yes, I think it is the case where you are updating the "hostname" and email address where it takes a long time (~8 seconds!). Perhaps you are right - it is trying to contact the website to download something while we're waiting around for it to answer us. I've also seen it come back with a garbled reply if I come back and try to read the data I just wrote too soon. The Link is the most finicky Harmony product I've worked with so far. :-) ------------------------------------------------------------------------------ Get your SQL database under version control now! Version control is standard for application code, but databases havent caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out. http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk _______________________________________________ concordance-devel mailing list concordance-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/concordance-devel