Main Lemma Repository
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ChargedWellCasing.cpp 4.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 14/04/19 15:39:02
  11. * @version $Id$
  12. * @author Trevor Irons (ti)
  13. * @email Trevor.Irons@utah.edu
  14. * @copyright Copyright (c) 2019, University of Utah
  15. * @copyright Copyright (c) 2019, Lemma Software, LLC
  16. */
  17. #include "ChargedWellCasing.h"
  18. namespace Lemma {
  19. // ==================== FRIEND METHODS =====================
  20. std::ostream &operator << (std::ostream &stream, const ChargedWellCasing &ob) {
  21. stream << ob.Serialize() << "\n---\n"; // End of doc ---
  22. return stream;
  23. }
  24. // ==================== LIFECYCLE =======================
  25. //--------------------------------------------------------------------------------------
  26. // Class: ChargedWellCasing
  27. // Method: ChargedWellCasing
  28. // Description: constructor (locked)
  29. //--------------------------------------------------------------------------------------
  30. ChargedWellCasing::ChargedWellCasing (const ctor_key&) : LemmaObject( LemmaObject::ctor_key() ) {
  31. } // ----- end of method ChargedWellCasing::ChargedWellCasing (constructor) -----
  32. //--------------------------------------------------------------------------------------
  33. // Class: ChargedWellCasing
  34. // Method: ChargedWellCasing
  35. // Description: DeSerializing constructor (locked)
  36. //--------------------------------------------------------------------------------------
  37. ChargedWellCasing::ChargedWellCasing (const YAML::Node& node, const ctor_key&) :
  38. LemmaObject(node, LemmaObject::ctor_key()) {
  39. } // ----- end of method ChargedWellCasing::ChargedWellCasing (constructor) -----
  40. //--------------------------------------------------------------------------------------
  41. // Class: ChargedWellCasing
  42. // Method: NewSP()
  43. // Description: public constructor returing a shared_ptr
  44. //--------------------------------------------------------------------------------------
  45. std::shared_ptr< ChargedWellCasing > ChargedWellCasing::NewSP() {
  46. return std::make_shared< ChargedWellCasing >( ctor_key() );
  47. }
  48. //--------------------------------------------------------------------------------------
  49. // Class: ChargedWellCasing
  50. // Method: ~ChargedWellCasing
  51. // Description: destructor (protected)
  52. //--------------------------------------------------------------------------------------
  53. ChargedWellCasing::~ChargedWellCasing () {
  54. } // ----- end of method ChargedWellCasing::~ChargedWellCasing (destructor) -----
  55. //--------------------------------------------------------------------------------------
  56. // Class: ChargedWellCasing
  57. // Method: Serialize
  58. //--------------------------------------------------------------------------------------
  59. YAML::Node ChargedWellCasing::Serialize ( ) const {
  60. YAML::Node node = LemmaObject::Serialize();
  61. node.SetTag( GetName() );
  62. // FILL IN CLASS SPECIFICS HERE
  63. return node;
  64. } // ----- end of method ChargedWellCasing::Serialize -----
  65. //--------------------------------------------------------------------------------------
  66. // Class: ChargedWellCasing
  67. // Method: DeSerialize
  68. //--------------------------------------------------------------------------------------
  69. std::shared_ptr<ChargedWellCasing> ChargedWellCasing::DeSerialize ( const YAML::Node& node ) {
  70. if (node.Tag() != "ChargedWellCasing" ) {
  71. throw DeSerializeTypeMismatch( "ChargedWellCasing", node.Tag());
  72. }
  73. return std::make_shared< ChargedWellCasing > ( node, ctor_key() );
  74. } // ----- end of method ChargedWellCasing::DeSerialize -----
  75. } // ---- end of namespace Lemma ----
  76. /* vim: set tabstop=4 expandtab: */
  77. /* vim: set filetype=cpp: */