Tpetra parallel linear algebra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Tpetra_Packable.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Tpetra: Templated Linear Algebra Services Package
4 //
5 // Copyright 2008 NTESS and the Tpetra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef TPETRA_PACKABLE_DECL_HPP
11 #define TPETRA_PACKABLE_DECL_HPP
12 
15 
16 #include "Tpetra_Packable_fwd.hpp"
17 
18 #ifndef DOXYGEN_SHOULD_SKIP_THIS
19 namespace Teuchos {
20  // Forward declarations
21  template <class T> class Array;
22  template <class T> class ArrayView;
23 } // namespace Teuchos
24 
25 #endif // DOXYGEN_SHOULD_SKIP_THIS
26 
27 namespace Tpetra {
62  template<class Packet,
63  class LocalOrdinal>
64  class Packable {
65  public:
86  virtual void
87  pack (const Teuchos::ArrayView<const LocalOrdinal>& exportLIDs,
88  Teuchos::Array<Packet>& exports,
89  const Teuchos::ArrayView<size_t>& numPacketsPerLID,
90  size_t& constantNumPackets) const = 0;
91 
93  virtual ~Packable () {}
94  };
95 } // namespace Tpetra
96 
97 #endif /* TPETRA_PACKABLE_DECL_HPP */
Forward declaration of Tpetra::Packable.
virtual ~Packable()
Destructor (virtual for memory safety of derived classes).
virtual void pack(const Teuchos::ArrayView< const LocalOrdinal > &exportLIDs, Teuchos::Array< Packet > &exports, const Teuchos::ArrayView< size_t > &numPacketsPerLID, size_t &constantNumPackets) const =0
Pack the object&#39;s data for an Import or Export.
Abstract base class for objects that can be the source of an Import or Export operation, and that also know how to pack their data to send to the target object.