Lemma is an Electromagnetics API
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

LemmaObject.cpp 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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