Lemma is an Electromagnetics API
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.

HankelTransformFactory.h 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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 04/18/2018 11:59:00 AM
  11. * @version $Id$
  12. * @author Trevor Irons (ti)
  13. * @email tirons@egi.utah.edu
  14. * @copyright Copyright (c) 2018, University of Utah
  15. * @copyright Copyright (c) 2018, Lemma Software, LLC
  16. */
  17. #pragma once
  18. #include "LemmaObject.h"
  19. #include "FHTAnderson801.h"
  20. #include "FHTKey201.h"
  21. namespace Lemma {
  22. /**
  23. * \ingroup FDEM1D
  24. * \brief Factory generator of HankelTranform types
  25. * \details
  26. */
  27. class HankelTransformFactory : public LemmaObject {
  28. friend std::ostream &operator<<(std::ostream &stream, const HankelTransformFactory &ob);
  29. protected:
  30. /*
  31. * This key is used to lock the constructor. It is protected so that inhereted
  32. * classes also have the key to contruct their base class.
  33. */
  34. struct ctor_key {};
  35. public:
  36. // ==================== LIFECYCLE =======================
  37. /**
  38. * Default constructor.
  39. * @note This method is locked, and cannot be called directly.
  40. * The reason that the method is public is to enable the use
  41. * of make_shared whilst enforcing the use of shared_ptr,
  42. * in c++-17, this curiosity may be resolved.
  43. * @see HankelTransformFactory::NewSP
  44. */
  45. explicit HankelTransformFactory ( const ctor_key& );
  46. /**
  47. * DeSerializing constructor.
  48. * @note This method is locked, and cannot be called directly.
  49. * The reason that the method is public is to enable the use
  50. * of make_shared whilst enforcing the use of shared_ptr,
  51. * in c++-17, this curiosity may be resolved.
  52. * @see HankelTransformFactory::DeSerialize
  53. */
  54. HankelTransformFactory ( const YAML::Node& node, const ctor_key& );
  55. /**
  56. * Default destructor.
  57. * @note This method should never be called due to the mandated
  58. * use of smart pointers. It is necessary to keep the method
  59. * public in order to allow for the use of the more efficient
  60. * make_shared constructor.
  61. */
  62. virtual ~HankelTransformFactory ();
  63. /**
  64. * Uses YAML to serialize this object.
  65. * @return a YAML::Node
  66. * @see HankelTransformFactory::DeSerialize
  67. */
  68. virtual YAML::Node Serialize() const;
  69. /*
  70. * Factory method for generating concrete class.
  71. * @return a std::shared_ptr of type HankelTransformFactory
  72. */
  73. //static std::shared_ptr< HankelTransformFactory > NewSP();
  74. static std::shared_ptr< HankelTransform > NewSP( const HANKELTRANSFORMTYPE Type) {
  75. switch (Type) {
  76. case ANDERSON801:
  77. break;
  78. }
  79. return FHTKey201::NewSP();
  80. //return FHTAnderson801::NewSP();
  81. }
  82. /**
  83. * Constructs an HankelTransformFactory object from a YAML::Node.
  84. * @see HankelTransformFactory::Serialize
  85. */
  86. static std::shared_ptr<HankelTransformFactory> DeSerialize(const YAML::Node& node);
  87. // ==================== OPERATORS =======================
  88. // ==================== OPERATIONS =======================
  89. // ==================== ACCESS =======================
  90. // ==================== INQUIRY =======================
  91. /**
  92. * Returns the name of the underlying class, similiar to Python's type
  93. * @return string of class name
  94. */
  95. virtual inline std::string GetName() const {
  96. return CName;
  97. }
  98. protected:
  99. // ==================== LIFECYCLE =======================
  100. /** Copy is disabled */
  101. HankelTransformFactory( const HankelTransformFactory& ) = delete;
  102. // ==================== DATA MEMBERS =========================
  103. private:
  104. /** ASCII string representation of the class name */
  105. static constexpr auto CName = "HankelTransformFactory";
  106. }; // ----- end of class HankelTransformFactory -----
  107. } // ----- end of namespace Lemma ----
  108. /* vim: set tabstop=4 expandtab: */
  109. /* vim: set filetype=cpp: */