[Box Backup-dev] COMMIT r348 - in box/chris/bb-save-state: . bin/bbackupd lib/common lib/server

Chris Wilson boxbackup-dev@fluffy.co.uk
Mon, 30 Jan 2006 19:06:27 +0000 (GMT)


Hi Ben,

>> >  I would have removed the operator overloading from Archive, and 
>> >  personally would have just required that classes derived from Archive 
>> >  only provide Read(void*,int length) and Write(void*,int length) 
>> >  functions, rather than doing absolutely everything, and made base class 
>> >  Get and Put inline functions which call those.
>> 
>>  I considered doing that, but I didn't want to introduce too many changes 
>>  at once.
>
> Go wild! It's not as if it's in trunk.

OK, I've done something similar (entirely replaced Get() and Add() with 
Read() and Write()) in the bb-save-state branch. I removed all operator 
overloading. Hopefully it should be much easier to drop in Protocol as a 
replacement for Archive now, requiring very few changes to the main body 
of code.

> Well, if you only refer to a class by it's name as pointers or 
> references, such as when you're defining it as an argument to a function 
> in a .h file, you don't need to include the file. You've just got to 
> tell the compiler that Archive is actually a class.

OK, will try to find time to do that, but not tonight and probably not 
tomorrow.

> Also, in my experience, defining virtual functions inline in header 
> files causes problems with compilers. I'm sure MSVC has been fixed now, 
> but still... :-)

I agree with you and Martin that it's not a good thing to use virtual 
inlined methods.

Cheers, Chris.
-- 
_ ___ __     _
  / __/ / ,__(_)_  | Chris Wilson <0000 at qwirx.com> - Cambs UK |
/ (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Perl/SQL/HTML Developer |
\ _/_/_/_//_/___/ | We are GNU-free your mind-and your software |