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.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. // ==================== LIFECYCLE ==============================
  14. // Constructor
  15. LemmaObject::LemmaObject( const ctor_key& ) {
  16. }
  17. LemmaObject::LemmaObject( const YAML::Node &node, const ctor_key& ) {
  18. }
  19. // Destructor
  20. LemmaObject::~LemmaObject() {
  21. }
  22. // ==================== OPERATIONS ==============================
  23. // ==================== INQUIRY ==============================
  24. inline std::string LemmaObject::GetName() const {
  25. return CName;
  26. }
  27. // ==================== ACCESS ==============================
  28. // ==================== ACCESS ==============================
  29. // ==================== OPERATORS ==============================
  30. //////////////////////////////////////////////////////////////////////
  31. //////////////////////////////////////////////////////////////////////
  32. DeSerializeTypeMismatch::DeSerializeTypeMismatch(const std::string& expected, const std::string& got) :
  33. runtime_error("DESERIALIZE TYPE MISMATCH") {
  34. std::cerr << "Expected " << expected << " got " << got << std::endl;
  35. }
  36. RequestToReturnNullPointer::
  37. RequestToReturnNullPointer(LemmaObject *ptr) :
  38. runtime_error("REQUEST TO RETURN NULL POINTER"){
  39. std::cerr << "Thrown by instance of "
  40. << ptr->GetName() << std::endl;
  41. }
  42. MatFileCannotBeOpened::
  43. MatFileCannotBeOpened() :
  44. runtime_error("MATFILE CANNOT BE OPENED"){}
  45. AssignmentOutOfBounds::
  46. AssignmentOutOfBounds(LemmaObject *ptr) :
  47. runtime_error("ASSIGNMENT OUT OF BOUNDS"){
  48. std::cerr << "Thrown by instance of "
  49. << ptr->GetName() << std::endl;
  50. }
  51. GenericFileIOError::
  52. GenericFileIOError(LemmaObject *ptr, const std::string &filename) : runtime_error("FILE I/O ERROR"){
  53. std::cerr << std::endl;
  54. std::cerr << "FILE I/O ERROR" << std::endl;
  55. std::cerr << std::endl;
  56. std::cerr << "Thrown by instance of "
  57. << ptr->GetName() << std::endl;
  58. std::cerr << " while trying to access " << filename << std::endl;
  59. std::cerr << std::endl;
  60. }
  61. } // end of namespace Lemma