I finally moved LocalPeer to the namespace Gnutella. I also moved all members of LocalPeer to LocalPeerPrivate in order to reduce the dependencies of the header file. However, I had to make a hack for Calitko to work after that. The thing is that the members (PacketProcessor, Handhsaker and the others) need to be members, so that even objects that are not yet initialized have valid pointers. This is necessary because, when initializing the interdependent objects, the pointers to their dependencies are saved in member variables. For example, Handshaker has a pointer to NodeCache, which is initialize in the constructor with a call to LocalPeer‘a object. The problem was that now LocalPeer’s functions were called before LocalPeerPrivate *p member has been set thus causing a crash! The workaround is performed by the first member of LocalPeerPrivate - an object of the Workaround class. It does set LocalPeer::p before the contructor of any other contained object is called.
Committed in revision 16.
