Base class for classes with non-standard packing and unpacking.
Base class for classes with non-standard packing and unpacking.This class is the base class for all data, you want to transmit, for which there are no standard PvmRegister()-Calls (see PvmStruct). For all types, that can be registered via PvmRegister()-Calls, there are functions called PvmPack( const Type & ) and PvmUnpack ( type ), which can be used in the Pack() and UnPack()-methods of PvmCustom. You can also use this mechanism, if you want to transmit data "compressed". For example you could have a huge array, that is mostly used with little data:
struct MyHugeArray : public PvmCustom { int Size; int Huge[100000]; void Pack () const { PvmPack (Size); for (int i = 0; i < Size; ++i) PvmPack (Huge[i]); } void UnPack () { PvmUnpack (Size); for (int i = 0; i < Size; ++i) PvmUnpack (Huge[i]); } }; struct Test : public PvmStruct { PvmSetStructId (43); PvmRegistration () { PvmRegister (Data); } MyHugeArray Data; }; int main () { Test A; A.Data.Size = 3; A.Data.Huge[ 0 ] = 4; A.Data.Huge[ 1 ] = 8; A.Data.Huge[ 2 ] = 16; A.Send (Pvm ().I ().Parent ()); // Only 4 ints are sent, not 100001 ! }
Alphabetic index Hierarchy of classes