Main Lemma Repository
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

Data.h 2.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. /** Copies the *structure* of this class to a new object and
  30. * returns a pointer to this object. Memory management is
  31. * the responsibility of the receiver!. The data values are
  32. * not copied.
  33. */
  34. virtual Data* Clone()=0;
  35. // ==================== OPERATORS =======================
  36. // ==================== OPERATIONS =======================
  37. /** Clears all data arrays and containers
  38. */
  39. virtual void Zero()=0;
  40. /** Data2 needs to be compatible with the calling class. Data2 will
  41. * be cast into the calling class type. Most of the time this
  42. * cast will not perform anything, as Data2 *is* the same type
  43. * as the calling class.
  44. */
  45. virtual Real Norm(Data* Data2)=0;
  46. // ==================== ACCESS =======================
  47. // ==================== INQUIRY =======================
  48. /** Returns the name of the underlying class, similiar to Python's type */
  49. virtual inline std::string GetName() const {
  50. return CName;
  51. }
  52. protected:
  53. // ==================== LIFECYCLE =======================
  54. /** Default protected constructor. */
  55. Data ( );
  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. }; // ----- end of class Data -----
  63. } // ----- end of Lemma name -----
  64. #endif // ----- #ifndef _DATA_H_INC -----
  65. /* vim: set tabstop=4 expandtab: */
  66. /* vim: set filetype=cpp: */