Main Lemma Repository
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DataReader.h 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* This file is part of Lemma, a geophysical modelling and inversion API */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. /**
  6. @file
  7. @author Trevor Irons
  8. @date 03/01/2010
  9. @version $Id: datareader.h 193 2014-11-10 23:51:41Z tirons $
  10. **/
  11. #ifndef DATAREADER_H_INC
  12. #define DATAREADER_H_INC
  13. #include "LemmaObject.h"
  14. #include "Data.h"
  15. namespace Lemma {
  16. // ===================================================================
  17. // Class: DataReader
  18. /// \brief Abstract class whose derived members read data files and
  19. /// converts them to Data Classes
  20. /// \details
  21. // ===================================================================
  22. class DataReader : public LemmaObject {
  23. friend std::ostream &operator<<(std::ostream &stream,
  24. const DataReader &ob);
  25. public:
  26. // ==================== LIFECYCLE =======================
  27. // ==================== OPERATORS =======================
  28. // ==================== OPERATIONS =======================
  29. // ==================== ACCESS =======================
  30. virtual Data* GetData()=0;
  31. // ==================== INQUIRY =======================
  32. /** Returns the name of the underlying class, similiar to Python's type */
  33. virtual inline std::string GetName() const {
  34. return CName;
  35. }
  36. protected:
  37. // ==================== LIFECYCLE =======================
  38. /// Default protected constructor.
  39. DataReader ( );
  40. /// Default protected constructor.
  41. ~DataReader ( );
  42. // ==================== DATA MEMBERS =========================
  43. private:
  44. /** ASCII string representation of the class name */
  45. static constexpr auto CName = "DataReader";
  46. }; // ----- end of class DataReader -----
  47. } // ----- end of Lemma name -----
  48. #endif // ----- #ifndef DATAREADER_H_INC -----
  49. /* vim: set tabstop=4 expandtab: */
  50. /* vim: set filetype=cpp: */