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.

TEMInductiveReceiver.cpp 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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 10/08/2014 03:19:58 PM
  11. * @version $Id$
  12. * @author Trevor Irons (ti)
  13. * @email Trevor.Irons@xri-geo.com
  14. * @copyright Copyright (c) 2014, XRI Geophysics, LLC
  15. * @copyright Copyright (c) 2014, Trevor Irons
  16. */
  17. #include "TEMInductiveReceiver.h"
  18. namespace Lemma {
  19. // ==================== FRIEND METHODS =====================
  20. #ifdef HAVE_YAMLCPP
  21. std::ostream &operator << (std::ostream &stream, const TEMInductiveReceiver &ob) {
  22. stream << ob.Serialize() << "\n---\n"; // End of doc --- as a direct stream should encapulste thingy
  23. return stream;
  24. }
  25. #else
  26. std::ostream &operator<<(std::ostream &stream, const TEMInductiveReceiver& ob) {
  27. stream << *(TEMReceiver*)(&ob);
  28. return stream;
  29. }
  30. #endif
  31. // ==================== LIFECYCLE =======================
  32. //--------------------------------------------------------------------------------------
  33. // Class: TEMInductiveReceiver
  34. // Method: TEMInductiveReceiver
  35. // Description: constructor (protected)
  36. //--------------------------------------------------------------------------------------
  37. TEMInductiveReceiver::TEMInductiveReceiver (const std::string& name) : TEMReceiver(name) {
  38. } // ----- end of method TEMInductiveReceiver::TEMInductiveReceiver (constructor) -----
  39. #ifdef HAVE_YAMLCPP
  40. //--------------------------------------------------------------------------------------
  41. // Class: TEMInductiveReceiver
  42. // Method: TEMInductiveReceiver
  43. // Description: constructor (protected)
  44. //--------------------------------------------------------------------------------------
  45. TEMInductiveReceiver::TEMInductiveReceiver (const YAML::Node& node) : TEMReceiver(node) {
  46. } // ----- end of method TEMInductiveReceiver::TEMInductiveReceiver (constructor) -----
  47. #endif
  48. //--------------------------------------------------------------------------------------
  49. // Class: TEMInductiveReceiver
  50. // Method: New()
  51. // Description: public constructor
  52. //--------------------------------------------------------------------------------------
  53. TEMInductiveReceiver* TEMInductiveReceiver::New() {
  54. TEMInductiveReceiver* Obj = new TEMInductiveReceiver("TEMInductiveReceiver");
  55. Obj->AttachTo(Obj);
  56. return Obj;
  57. }
  58. //--------------------------------------------------------------------------------------
  59. // Class: TEMInductiveReceiver
  60. // Method: ~TEMInductiveReceiver
  61. // Description: destructor (protected)
  62. //--------------------------------------------------------------------------------------
  63. TEMInductiveReceiver::~TEMInductiveReceiver () {
  64. } // ----- end of method TEMInductiveReceiver::~TEMInductiveReceiver (destructor) -----
  65. //--------------------------------------------------------------------------------------
  66. // Class: TEMInductiveReceiver
  67. // Method: Delete
  68. // Description: public destructor
  69. //--------------------------------------------------------------------------------------
  70. void TEMInductiveReceiver::Delete() {
  71. this->DetachFrom(this);
  72. }
  73. //--------------------------------------------------------------------------------------
  74. // Class: TEMInductiveReceiver
  75. // Method: Release
  76. // Description: destructor (protected)
  77. //--------------------------------------------------------------------------------------
  78. void TEMInductiveReceiver::Release() {
  79. delete this;
  80. }
  81. #ifdef HAVE_YAMLCPP
  82. //--------------------------------------------------------------------------------------
  83. // Class: TEMInductiveReceiver
  84. // Method: Serialize
  85. //--------------------------------------------------------------------------------------
  86. YAML::Node TEMInductiveReceiver::Serialize ( ) const {
  87. YAML::Node node;
  88. node = TEMReceiver::Serialize();
  89. node.SetTag( this->Name ); // Set Tag after doing parents
  90. return node;
  91. } // ----- end of method TEMInductiveReceiver::Serialize -----
  92. //--------------------------------------------------------------------------------------
  93. // Class: TEMInductiveReceiver
  94. // Method: DeSerialize
  95. //--------------------------------------------------------------------------------------
  96. TEMInductiveReceiver* TEMInductiveReceiver::DeSerialize ( const YAML::Node& node ) {
  97. TEMInductiveReceiver* Object = new TEMInductiveReceiver(node);
  98. Object->AttachTo(Object);
  99. DESERIALIZECHECK( node, Object )
  100. return Object ;
  101. } // ----- end of method TEMInductiveReceiver::DeSerialize -----
  102. #endif
  103. } // ----- end of Lemma name -----