Skip to content
Snippets Groups Projects
Select Git revision
  • 49b34d4c94e40c1b44e52d254a359ae55ddc2fdd
  • master default protected
  • 6.x protected
  • madysson
  • 5.x protected
  • asm
  • time-varying-information-set
  • 4.6 protected
  • dynare_minreal
  • dragonfly
  • various_fixes
  • 4.5 protected
  • clang+openmp
  • exo_steady_state
  • declare_vars_in_model_block
  • julia
  • error_msg_undeclared_model_vars
  • static_aux_vars
  • slice
  • aux_func
  • penalty
  • 6.4 protected
  • 6.3 protected
  • 6.2 protected
  • 6.1 protected
  • 6.0 protected
  • 6-beta2 protected
  • 6-beta1 protected
  • 5.5 protected
  • 5.4 protected
  • 5.3 protected
  • 5.2 protected
  • 5.1 protected
  • 5.0 protected
  • 5.0-rc1 protected
  • 4.7-beta3 protected
  • 4.7-beta2 protected
  • 4.7-beta1 protected
  • 4.6.4 protected
  • 4.6.3 protected
  • 4.6.2 protected
41 results

ModFile.hh

Blame
  • exception.hh 846 B
    // Copyright (C) 2005, Ondra Kamenik
    
    // $Id: exception.h 1367 2007-07-11 14:21:57Z kamenik $
    
    #ifndef OGU_EXCEPTION_H
    #define OGU_EXCEPTION_H
    
    #include <string>
    #include <iostream>
    #include <utility>
    
    namespace ogu
    {
      /** A primitive exception. */
      class Exception
      {
      protected:
        const std::string file;
        const int line;
        const std::string mes;
      public:
        Exception(std::string file_arg, int line_arg, std::string mes_arg)
          : file{std::move(file_arg)},
            line{line_arg},
            mes{std::move(mes_arg)}
        {
        }
        virtual ~Exception() = default;
    
        void
        print(std::ostream &out) const
        {
          out << file << ':' << line << ": " << mes << std::endl;
        }
    
        void
        print() const
        {
          print(std::cout);
        }
    
        std::string
        message() const
        {
          return mes;
        }
      };
    };
    
    #endif