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.

Data.h 2.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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: data.h 193 2014-11-10 23:51:41Z tirons $
  10. **/
  11. #ifndef _DATA_H_INC
  12. #define _DATA_H_INC
  13. #include "LemmaObject.h"
  14. namespace Lemma {
  15. // ===================================================================
  16. // Class: Data
  17. /**
  18. * \ingroup LemmaCore
  19. * \brief Abstract class for data from an instrument
  20. * \details Currently provides no functionality, but this will likely
  21. * change in the near future.
  22. */
  23. // ===================================================================
  24. class Data : public LemmaObject {
  25. friend std::ostream &operator<<(std::ostream &stream,
  26. const Data &ob);
  27. public:
  28. // ==================== LIFECYCLE =======================
  29. /**
  30. * Returns a deep copy
  31. */
  32. virtual std::shared_ptr<Data> DeepCopy()=0;
  33. // ==================== OPERATORS =======================
  34. // ==================== OPERATIONS =======================
  35. /** Clears all data arrays and containers
  36. */
  37. virtual void Zero()=0;
  38. /** Data2 needs to be compatible with the calling class. Data2 will
  39. * be cast into the calling class type. Most of the time this
  40. * cast will not perform anything, as Data2 *is* the same type
  41. * as the calling class.
  42. */
  43. virtual Real Norm(Data* Data2)=0;
  44. // ==================== ACCESS =======================
  45. // ==================== INQUIRY =======================
  46. /** Returns the name of the underlying class, similiar to Python's type */
  47. virtual inline std::string GetName() const {
  48. return CName;
  49. }
  50. protected:
  51. // ==================== LIFECYCLE =======================
  52. /** Default protected constructor. */
  53. Data ( const ctor_key& key );
  54. /** Deserializing contructor */
  55. Data ( const YAML::Node& node, const ctor_key& key );
  56. /** Default protected constructor. */
  57. ~Data ( );
  58. // ==================== DATA MEMBERS =========================
  59. private:
  60. /** ASCII string representation of the class name */
  61. static constexpr auto CName = "Data";
  62. Data ( const Data& ) = delete;
  63. }; // ----- end of class Data -----
  64. } // ----- end of Lemma name -----
  65. #endif // ----- #ifndef _DATA_H_INC -----
  66. /* vim: set tabstop=4 expandtab: */
  67. /* vim: set filetype=cpp: */