Skip to content
Snippets Groups Projects
Select Git revision
  • 9bd2973034cc62fb12851c6b4b24622e9e8e3231
  • master default protected
  • julia protected
  • 6.x protected
  • python-codegen
  • llvm-15
  • 5.x protected
  • 4.6 protected
  • uop
  • rework_pac
  • aux_vars_fix
  • julia-7.0.0
  • julia-6.4.0
  • julia-6.3.0
  • julia-6.2.0
15 results

StaticModel.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