Main Lemma Repository
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

DataReader.h 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. /// \ingroup LemmaCore
  19. /// \brief Abstract class whose derived members read data files and
  20. /// converts them to Data Classes
  21. /// \details
  22. // ===================================================================
  23. class DataReader : public LemmaObject {
  24. friend std::ostream &operator<<(std::ostream &stream,
  25. const DataReader &ob);
  26. public:
  27. // ==================== LIFECYCLE =======================
  28. // ==================== OPERATORS =======================
  29. // ==================== OPERATIONS =======================
  30. // ==================== ACCESS =======================
  31. virtual std::shared_ptr< Data > GetData()=0;
  32. // ==================== INQUIRY =======================
  33. /** Returns the name of the underlying class, similiar to Python's type */
  34. virtual inline std::string GetName() const {
  35. return CName;
  36. }
  37. protected:
  38. // ==================== LIFECYCLE =======================
  39. /// Default protected constructor.
  40. DataReader ( const ctor_key& key );
  41. /// Default protected constructor.
  42. DataReader ( const YAML::Node& node, const ctor_key& key );
  43. /// Default protected constructor.
  44. ~DataReader ( );
  45. // ==================== DATA MEMBERS =========================
  46. private:
  47. /** ASCII string representation of the class name */
  48. static constexpr auto CName = "DataReader";
  49. DataReader( const DataReader& ) = delete;
  50. }; // ----- end of class DataReader -----
  51. } // ----- end of Lemma name -----
  52. #endif // ----- #ifndef DATAREADER_H_INC -----
  53. /* vim: set tabstop=4 expandtab: */
  54. /* vim: set filetype=cpp: */