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.

LemmaObject.cpp 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 06/25/2009
  9. @version $Id: LemmaObject.cpp 266 2015-04-01 03:24:00Z tirons $
  10. **/
  11. #include "LemmaObject.h"
  12. namespace Lemma {
  13. YAML::Emitter& operator << (YAML::Emitter& out, const LemmaObject& ob) {
  14. out << YAML::BeginMap;
  15. out << YAML::Key <<"Class Name" << YAML::Value << ob.GetName();
  16. return out;
  17. }
  18. // ==================== LIFECYCLE ==============================
  19. // Constructor
  20. LemmaObject::LemmaObject( ) {
  21. }
  22. LemmaObject::LemmaObject(const YAML::Node &node) {
  23. }
  24. // Destructor
  25. LemmaObject::~LemmaObject() {
  26. }
  27. // ==================== OPERATIONS ==============================
  28. // ==================== INQUIRY ==============================
  29. // ==================== ACCESS ==============================
  30. // ==================== ACCESS ==============================
  31. // ==================== OPERATORS ==============================
  32. //////////////////////////////////////////////////////////////////////
  33. //////////////////////////////////////////////////////////////////////
  34. DeSerializeTypeMismatch::DeSerializeTypeMismatch(const std::string& expected, const std::string& got) :
  35. runtime_error("DESERIALIZE TYPE MISMATCH") {
  36. std::cerr << "Expected " << expected << " got " << got << std::endl;
  37. }
  38. RequestToReturnNullPointer::
  39. RequestToReturnNullPointer(LemmaObject *ptr) :
  40. runtime_error("REQUEST TO RETURN NULL POINTER"){
  41. std::cerr << "Thrown by instance of "
  42. << ptr->GetName() << std::endl;
  43. }
  44. MatFileCannotBeOpened::
  45. MatFileCannotBeOpened() :
  46. runtime_error("MATFILE CANNOT BE OPENED"){}
  47. AssignmentOutOfBounds::
  48. AssignmentOutOfBounds(LemmaObject *ptr) :
  49. runtime_error("ASSIGNMENT OUT OF BOUNDS"){
  50. std::cerr << "Thrown by instance of "
  51. << ptr->GetName() << std::endl;
  52. }
  53. GenericFileIOError::
  54. GenericFileIOError(LemmaObject *ptr, const std::string &filename) : runtime_error("FILE I/O ERROR"){
  55. std::cerr << std::endl;
  56. std::cerr << "FILE I/O ERROR" << std::endl;
  57. std::cerr << std::endl;
  58. std::cerr << "Thrown by instance of "
  59. << ptr->GetName() << std::endl;
  60. std::cerr << " while trying to access " << filename << std::endl;
  61. std::cerr << std::endl;
  62. }
  63. } // end of namespace Lemma