LCOV - code coverage report
Current view: top level - home/blackburn/Work/tapkee/include/tapkee - exceptions.hpp (source / functions) Hit Total Coverage
Test: clean.info Lines: 21 24 87.5 %
Date: 2013-05-24 Functions: 14 24 58.3 %
Branches: 7 16 43.8 %

           Branch data     Line data    Source code
       1                 :            : /* This software is distributed under BSD 3-clause license (see LICENSE file).
       2                 :            :  *
       3                 :            :  * Copyright (c) 2012-2013 Sergey Lisitsyn
       4                 :            :  */
       5                 :            : 
       6                 :            : #ifndef TAPKEE_EXCEPTIONS_H_
       7                 :            : #define TAPKEE_EXCEPTIONS_H_
       8                 :            : 
       9                 :            : #include <stdexcept>
      10                 :            : #include <string>
      11                 :            : 
      12                 :            : namespace tapkee
      13                 :            : {
      14                 :            : 
      15                 :            : //! An exception type that is thrown in case if wrong parameter
      16                 :            : //! value is passed.
      17         [ -  + ]:          1 : class wrong_parameter_error : public std::logic_error
      18                 :            : {
      19                 :            :         public:
      20                 :            :                 /** @param what_msg message of the exception */
      21                 :          1 :                 explicit wrong_parameter_error(const std::string& what_msg) : 
      22                 :          1 :                         std::logic_error(what_msg) {};
      23                 :            : };
      24                 :            : 
      25                 :            : //! An exception type that is thrown in case if wrong parameter
      26                 :            : //! value is passed.
      27         [ #  # ]:          0 : class wrong_parameter_type_error : public std::logic_error
      28                 :            : {
      29                 :            :         public:
      30                 :            :                 /** @param what_msg message of the exception */
      31                 :          0 :                 explicit wrong_parameter_type_error(const std::string& what_msg) : 
      32                 :          0 :                         std::logic_error(what_msg) {};
      33                 :            : };
      34                 :            : 
      35                 :            : //! An exception type that is thrown in case of missed parameter,
      36                 :            : //! i.e. when some required parameter is not set.
      37         [ -  + ]:          1 : class missed_parameter_error : public std::logic_error
      38                 :            : {
      39                 :            :         public:
      40                 :            :                 /** @param what_msg message of the exception */
      41                 :          1 :                 explicit missed_parameter_error(const std::string& what_msg) : 
      42                 :          1 :                         std::logic_error(what_msg) {};
      43                 :            : };
      44                 :            : 
      45                 :            : //! An exception type that is thrown when unsupported method
      46                 :            : //! is called.
      47         [ -  + ]:          1 : class unsupported_method_error : public std::logic_error
      48                 :            : {
      49                 :            :         public:
      50                 :            :                 /** @param what_msg message of the exception */
      51                 :          1 :                 explicit unsupported_method_error(const std::string& what_msg) : 
      52                 :          1 :                         std::logic_error(what_msg) {};
      53                 :            : };
      54                 :            : 
      55                 :            : //! An exception type that is thrown when the library can't get 
      56                 :            : //! enough memory.
      57         [ -  + ]:          1 : class not_enough_memory_error : public std::runtime_error
      58                 :            : {
      59                 :            :         public:
      60                 :            :                 /** @param what_msg message of the exception */
      61                 :          1 :                 explicit not_enough_memory_error(const std::string& what_msg) : 
      62                 :          1 :                         std::runtime_error(what_msg) {};
      63                 :            : };
      64                 :            : 
      65                 :            : //! An exception type that is thrown when some parameter is passed more than once
      66         [ -  + ]:          1 : class multiple_parameter_error : public std::runtime_error
      67                 :            : {
      68                 :            :         public:
      69                 :            :                 /** @param what_msg message of the exception */
      70                 :          1 :                 explicit multiple_parameter_error(const std::string& what_msg) : 
      71                 :          1 :                         std::runtime_error(what_msg) {};
      72                 :            : };
      73                 :            : 
      74                 :            : //! An exception type that is thrown when computations were 
      75                 :            : //! cancelled.
      76         [ -  + ]:          1 : class cancelled_exception : public std::exception
      77                 :            : {
      78                 :            :         public:
      79                 :          1 :                 explicit cancelled_exception() : 
      80                 :          1 :                         std::exception() {};
      81                 :            : };
      82                 :            : 
      83                 :            : //! An exception type that is thrown when eigendecomposition
      84                 :            : //! is failed.
      85         [ -  + ]:          1 : class eigendecomposition_error : public std::runtime_error
      86                 :            : {
      87                 :            :         public:
      88                 :            :                 /** @param what_msg message of the exception */
      89                 :          1 :                 explicit eigendecomposition_error(const std::string& what_msg) :
      90                 :          1 :                         std::runtime_error(what_msg) {};
      91                 :            : };
      92                 :            : 
      93                 :            : }
      94                 :            : #endif
      95                 :            : 

Generated by: LCOV version 1.9