The SHDistributable class represents a SockHop-compatible object that is part of a known add-on file, and can thus be automatically distributed to nodes on the SockHop tree. Its API is as follows:
This method is how SockHop finds out where the add-on file(s) that implement this object are. The user/installer of the SockHop program is responsible for making sure that the appropriate files are in the proper places on disk (usually relative to the root executable's current directory) at program startup. Note that the add-ons need only be put onto the disk of the root computer--SockHop will automatically propagate them to the other computers as needed.
If your object requires other files (such as shared libraries or data files) in order to be instantiated properly, it is okay to add those to the SHFileSpec as well. All specified files (for the appropriate architecture) will be downloaded before the SHDistributableObject is instantiated.
SHDistributableObject subclasses will should implement this method to add to (addToSpec) references to the appropriate add-on file or shared library that contains the class implementation for this object's class. All subclasses should also pass the GetAddOnSpec() call on to their parent class's GetAddOnSpec() implementation.
(An implementation note: This method is called when Archiving
the SHDistributableObject, not when unarchiving it! So you have to
specify your add-on files at the sending node, not at the receiving one)
This method should be called by the Archive() method of all SHDistributableObject subclasses. It adds information about this SHDistributableObject into (archive). In particular, it calls GetAddOnSpec(), and adds the resulting SHFileSpec to (archive) as a Flattened object. It may occasionally be necessary to manually retrieve this Flattened object from the archive BMessage--it can be found under the field name SH_NAME_ADDONSPEC. (Note: SH_NAME_ADDONSPEC is a #define in sockhop/SockHopConstants.h, not the literal text string! You should use the #define to avoid grief due to typos, upgrades, etc)
This method returns an ID number for the SHDistributableObject.
This number is mainly for SockHop's internal use. It is only guaranteed
to be unique across the node that the SHDistributableObject is living on,
and is NOT propogated with the object as the object moves from node to
node--that is, the ID number will change when the object moves to another
node. Use this method at your own risk...