Surface NMR forward modelling
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.

DataFID.h 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /* This file is part of Lemma, a geophysical modelling and inversion API.
  2. * More information is available at http://lemmasoftware.org
  3. */
  4. /* This Source Code Form is subject to the terms of the Mozilla Public
  5. * License, v. 2.0. If a copy of the MPL was not distributed with this
  6. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  7. */
  8. /**
  9. * @file
  10. * @date 08/28/2017 01:04:12 PM
  11. * @version $Id$
  12. * @author Trevor Irons (ti)
  13. * @email tirons@egi.utah.edu
  14. * @copyright Copyright (c) 2017, University of Utah
  15. * @copyright Copyright (c) 2017, Lemma Software, LLC
  16. */
  17. #ifndef DATAFID_INC
  18. #define DATAFID_INC
  19. #pragma once
  20. #include "MerlinObject.h"
  21. namespace Lemma {
  22. /**
  23. * \ingroup Merlin
  24. * \brief Base class for representation of FID data in Merlin.
  25. * \details Simplest form of FID data used in Merlin. Field data derives
  26. from this class for specific instrumentation details. See
  27. the Akvo project for further details (akvo.lemmasoftware.org).
  28. */
  29. class DataFID : public MerlinObject {
  30. friend std::ostream &operator<<(std::ostream &stream, const DataFID &ob);
  31. protected:
  32. /*
  33. * This key is used to lock the constructor. It is protected so that inhereted
  34. * classes also have the key to contruct their base class.
  35. */
  36. struct ctor_key {};
  37. public:
  38. // ==================== LIFECYCLE =======================
  39. /**
  40. * Default constructor.
  41. * @note This method is locked, and cannot be called directly.
  42. * The reason that the method is public is to enable the use
  43. * of make_shared whilst enforcing the use of shared_ptr,
  44. * in c++-17, this curiosity may be resolved.
  45. * @see DataFID::NewSP
  46. */
  47. explicit DataFID ( const ctor_key& );
  48. /**
  49. * DeSerializing constructor.
  50. * @note This method is locked, and cannot be called directly.
  51. * The reason that the method is public is to enable the use
  52. * of make_shared whilst enforcing the use of shared_ptr,
  53. * in c++-17, this curiosity may be resolved.
  54. * @see DataFID::DeSerialize
  55. */
  56. DataFID ( const YAML::Node& node, const ctor_key& );
  57. /**
  58. * Default destructor.
  59. * @note This method should never be called due to the mandated
  60. * use of smart pointers. It is necessary to keep the method
  61. * public in order to allow for the use of the more efficient
  62. * make_shared constructor.
  63. */
  64. virtual ~DataFID ();
  65. /**
  66. * Uses YAML to serialize this object.
  67. * @return a YAML::Node
  68. * @see DataFID::DeSerialize
  69. */
  70. virtual YAML::Node Serialize() const;
  71. /*
  72. * Factory method for generating concrete class.
  73. * @return a std::shared_ptr of type DataFID
  74. */
  75. static std::shared_ptr< DataFID > NewSP();
  76. /**
  77. * Constructs an DataFID object from a YAML::Node.
  78. * @see DataFID::Serialize
  79. */
  80. static std::shared_ptr<DataFID> DeSerialize(const YAML::Node& node);
  81. // ==================== OPERATORS =======================
  82. // ==================== OPERATIONS =======================
  83. // ==================== ACCESS =======================
  84. // ==================== INQUIRY =======================
  85. /**
  86. * Returns the name of the underlying class, similiar to Python's type
  87. * @return string of class name
  88. */
  89. virtual inline std::string GetName() const {
  90. return CName;
  91. }
  92. protected:
  93. // ==================== LIFECYCLE =======================
  94. /** Copy is disabled */
  95. DataFID( const DataFID& ) = delete;
  96. // ==================== DATA MEMBERS =========================
  97. private:
  98. /** ASCII string representation of the class name */
  99. static constexpr auto CName = "DataFID";
  100. }; // ----- end of class DataFID -----
  101. } // ----- end of namespace Lemma ----
  102. /* vim: set tabstop=4 expandtab: */
  103. /* vim: set filetype=cpp: */
  104. #endif // ----- #ifndef DATAFID_INC -----