Tpetra Matrix/Vector Services Version of the Day
|Virtual destructor. |
Any object that may be the source of an Import or Export data redistribution operation must inherit from this class. This class implements no methods, other than a trivial virtual destructor. If a subclass X inherits from this class, that indicates that the subclass can be the source of an Import or Export, for some set of subclasses of DistObject. A subclass Y of DistObject which is the target of the Import or Export operation will attempt to cast the input source SrcDistObject to a subclass which it knows how to treat as a source object. The target subclass Y is responsible for knowing what source classes to expect, and how to interpret the resulting source object.
DistObject inherits from this class, since a DistObject subclass may be either the source or the target of an Import or Export. A SrcDistObject subclass which does not inherit from DistObject need only be a valid source of an Import or Export; it need not be a valid target.
This object compares to the Epetra class Epetra_SrcDistObject. Unlike in Epetra, this class in Tpetra does
not include a getMap() method. This is for two reasons. First, consider the following inheritance hierarchy: DistObject and RowGraph inherit from SrcDistObject, and CrsGraph inherits from DistObject and RowGraph. If SrcDistObject had a virtual getMap method, that would make resolution of the method ambiguous. Second, it is not necessary for SrcDistObject to have a getMap method, because a SrcDistObject alone does not suffice as the source of an Import or Export. Any DistObject subclass must cast the SrcDistObject to a subclass which it knows how to treat as the source of an Import or Export. Thus, it's not necessary for SrcDistObject to have a getMap method, since it needs to be cast anyway before use. In general, I prefer to keep interfaces as simple as possible.