aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/kiwisolver/py3/kiwi/errors.h
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.com>2023-12-08 17:43:34 +0300
committershadchin <shadchin@yandex-team.com>2023-12-08 20:15:01 +0300
commit213cda016d72c7d8d0e55ac7a7351959fa6ca2b8 (patch)
treea0a9170141dd91d1ff0727c0faa1af58d7b81133 /contrib/python/kiwisolver/py3/kiwi/errors.h
parent914f57e3243f53dd89dd3adb4d8b6d35c47f46ce (diff)
downloadydb-213cda016d72c7d8d0e55ac7a7351959fa6ca2b8.tar.gz
Update kiwisolver to 1.2.0
Diffstat (limited to 'contrib/python/kiwisolver/py3/kiwi/errors.h')
-rw-r--r--contrib/python/kiwisolver/py3/kiwi/errors.h168
1 files changed, 71 insertions, 97 deletions
diff --git a/contrib/python/kiwisolver/py3/kiwi/errors.h b/contrib/python/kiwisolver/py3/kiwi/errors.h
index 6c77eee0b7..eb54560f4e 100644
--- a/contrib/python/kiwisolver/py3/kiwi/errors.h
+++ b/contrib/python/kiwisolver/py3/kiwi/errors.h
@@ -3,7 +3,7 @@
|
| Distributed under the terms of the Modified BSD License.
|
-| The full license is in the file COPYING.txt, distributed with this software.
+| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
#pragma once
#include <exception>
@@ -11,178 +11,152 @@
#include "constraint.h"
#include "variable.h"
-
namespace kiwi
{
-
class UnsatisfiableConstraint : public std::exception
{
public:
+ UnsatisfiableConstraint(const Constraint &constraint) : m_constraint(constraint) {}
- UnsatisfiableConstraint( const Constraint& constraint ) :
- m_constraint( constraint ) {}
-
- ~UnsatisfiableConstraint() throw() {}
+ ~UnsatisfiableConstraint() throw() {}
- const char* what() const throw()
- {
- return "The constraint can not be satisfied.";
- }
+ const char *what() const throw()
+ {
+ return "The constraint can not be satisfied.";
+ }
- const Constraint& constraint() const
- {
- return m_constraint;
- }
+ const Constraint &constraint() const
+ {
+ return m_constraint;
+ }
private:
-
- Constraint m_constraint;
+ Constraint m_constraint;
};
-
class UnknownConstraint : public std::exception
{
public:
+ UnknownConstraint(const Constraint &constraint) : m_constraint(constraint) {}
- UnknownConstraint( const Constraint& constraint ) :
- m_constraint( constraint ) {}
-
- ~UnknownConstraint() throw() {}
+ ~UnknownConstraint() throw() {}
- const char* what() const throw()
- {
- return "The constraint has not been added to the solver.";
- }
+ const char *what() const throw()
+ {
+ return "The constraint has not been added to the solver.";
+ }
- const Constraint& constraint() const
- {
- return m_constraint;
- }
+ const Constraint &constraint() const
+ {
+ return m_constraint;
+ }
private:
-
- Constraint m_constraint;
+ Constraint m_constraint;
};
-
class DuplicateConstraint : public std::exception
{
public:
+ DuplicateConstraint(const Constraint &constraint) : m_constraint(constraint) {}
- DuplicateConstraint( const Constraint& constraint ) :
- m_constraint( constraint ) {}
-
- ~DuplicateConstraint() throw() {}
+ ~DuplicateConstraint() throw() {}
- const char* what() const throw()
- {
- return "The constraint has already been added to the solver.";
- }
+ const char *what() const throw()
+ {
+ return "The constraint has already been added to the solver.";
+ }
- const Constraint& constraint() const
- {
- return m_constraint;
- }
+ const Constraint &constraint() const
+ {
+ return m_constraint;
+ }
private:
-
- Constraint m_constraint;
+ Constraint m_constraint;
};
-
class UnknownEditVariable : public std::exception
{
public:
+ UnknownEditVariable(const Variable &variable) : m_variable(variable) {}
- UnknownEditVariable( const Variable& variable ) :
- m_variable( variable ) {}
+ ~UnknownEditVariable() throw() {}
- ~UnknownEditVariable() throw() {}
+ const char *what() const throw()
+ {
+ return "The edit variable has not been added to the solver.";
+ }
- const char* what() const throw()
- {
- return "The edit variable has not been added to the solver.";
- }
-
- const Variable& variable() const
- {
- return m_variable;
- }
+ const Variable &variable() const
+ {
+ return m_variable;
+ }
private:
-
- Variable m_variable;
+ Variable m_variable;
};
-
class DuplicateEditVariable : public std::exception
{
public:
+ DuplicateEditVariable(const Variable &variable) : m_variable(variable) {}
- DuplicateEditVariable( const Variable& variable ) :
- m_variable( variable ) {}
+ ~DuplicateEditVariable() throw() {}
- ~DuplicateEditVariable() throw() {}
+ const char *what() const throw()
+ {
+ return "The edit variable has already been added to the solver.";
+ }
- const char* what() const throw()
- {
- return "The edit variable has already been added to the solver.";
- }
-
- const Variable& variable() const
- {
- return m_variable;
- }
+ const Variable &variable() const
+ {
+ return m_variable;
+ }
private:
-
- Variable m_variable;
+ Variable m_variable;
};
-
class BadRequiredStrength : public std::exception
{
public:
+ BadRequiredStrength() {}
- BadRequiredStrength() {}
-
- ~BadRequiredStrength() throw() {}
+ ~BadRequiredStrength() throw() {}
- const char* what() const throw()
- {
- return "A required strength cannot be used in this context.";
- }
+ const char *what() const throw()
+ {
+ return "A required strength cannot be used in this context.";
+ }
};
-
class InternalSolverError : public std::exception
{
public:
+ InternalSolverError() : m_msg("An internal solver error ocurred.") {}
- InternalSolverError() : m_msg( "An internal solver error ocurred." ) {}
+ InternalSolverError(const char *msg) : m_msg(msg) {}
- InternalSolverError( const char* msg ) : m_msg( msg ) {}
+ InternalSolverError(const std::string &msg) : m_msg(msg) {}
- InternalSolverError( const std::string& msg ) : m_msg( msg ) {}
+ ~InternalSolverError() throw() {}
- ~InternalSolverError() throw() {}
-
- const char* what() const throw()
- {
- return m_msg.c_str();
- }
+ const char *what() const throw()
+ {
+ return m_msg.c_str();
+ }
private:
-
- std::string m_msg;
+ std::string m_msg;
};
} // namespace kiwi