| 1 |
// @HEADER |
| 2 |
// ***************************************************************************** |
| 3 |
// Anasazi: Block Eigensolvers Package |
| 4 |
// |
| 5 |
// Copyright 2004 NTESS and the Anasazi contributors. |
| 6 |
// SPDX-License-Identifier: BSD-3-Clause |
| 7 |
// ***************************************************************************** |
| 8 |
// @HEADER |
| 9 |
|
| 10 |
#ifndef RBGEN_FILE_IO_HANDLER_HPP |
| 11 |
#define RBGEN_FILE_IO_HANDLER_HPP |
| 12 |
|
| 13 |
#include "RBGen_ConfigDefs.h" |
| 14 |
|
| 15 |
#include "Teuchos_ParameterList.hpp" |
| 16 |
#include "Teuchos_RCP.hpp" |
| 17 |
|
| 18 |
namespace RBGen { |
| 19 |
|
| 20 |
//! Abstract base class for reading datasets from files. |
| 21 |
/*! |
| 22 |
*/ |
| 23 |
template<class DataSetType> |
| 24 |
class FileIOHandler { |
| 25 |
public: |
| 26 |
//! @name Constructor/Destructor. |
| 27 |
//@{ |
| 28 |
|
| 29 |
//! Default constructor. |
| 30 |
FileIOHandler() {}; |
| 31 |
|
| 32 |
//! Destructor. |
| 33 |
virtual ~FileIOHandler() {}; |
| 34 |
//@} |
| 35 |
|
| 36 |
//! @name Initialization/Reset Methods |
| 37 |
//@{ |
| 38 |
|
| 39 |
//! Initialize file reader using |
| 40 |
virtual void Initialize( const Teuchos::RCP<Teuchos::ParameterList>& params ) = 0; |
| 41 |
|
| 42 |
void Reset() {}; |
| 43 |
//@} |
| 44 |
|
| 45 |
//! @name File Reading Methods |
| 46 |
//@{ |
| 47 |
|
| 48 |
//! Method for reading multiple files and putting them into an data set. |
| 49 |
virtual Teuchos::RCP< DataSetType > Read( const std::vector<std::string>& filenames ) = 0; |
| 50 |
|
| 51 |
//@} |
| 52 |
|
| 53 |
//! @name Writing Methods |
| 54 |
//@{ |
| 55 |
|
| 56 |
//! Method for writing one data set into a file. |
| 57 |
virtual void Write( const Teuchos::RCP< const DataSetType >& MV, const std::string& filename ) = 0; |
| 58 |
|
| 59 |
//@} |
| 60 |
|
| 61 |
//! @name Handler Status Methods |
| 62 |
//@{ |
| 63 |
|
| 64 |
//! Return initialized status of the handler |
| 65 |
virtual bool isInitialized() const = 0; |
| 66 |
|
| 67 |
//@} |
| 68 |
}; |
| 69 |
|
| 70 |
} // end of RBGen namespace |
| 71 |
|
| 72 |
#endif // RBGEN_FILE_IO_HANDLER_HPP |