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.

LemmaObject.cpp 2.8KB

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