Skip to content
Snippets Groups Projects
Select Git revision
  • 6dc870727d33927a67eceb1a89fc4ed8bd320ac6
  • master default protected
  • nlf-fixes
  • DSMH
  • OneStep2
  • SMC
  • online-filter-as-a-sampler
  • nonlinear-filter-fixes
  • SMCsamplers
  • smc-sampler
  • 4.5
  • dynamic-striated
  • occbin
  • exo_steady_state
  • filter_initial_state
  • declare_vars_in_model_block
  • exceptions
  • rmExtraExo
  • julia
  • error_msg_undeclared_model_vars
  • static_aux_vars
  • 4.5.6
  • 4.5.5
  • 4.5.4
  • 4.5.3
  • 4.5.2
  • 4.5.1
  • 4.5.0
  • 4.4.3
  • 4.4.2
  • 4.4.1
  • 4.4.0
  • 4.4-beta1
  • 4.3.3
  • 4.3.2
  • 4.3.1
  • 4.3.0
  • 4.2.5
  • 4.2.4
  • 4.2.3
  • 4.2.2
41 results

ModFile.hh

Blame
  • Forked from Dynare / dynare
    Source project has a limited visibility.
    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