Sauce-0.10.1 A C++ Dependency Injection Framework

- Main Page
- Classes
- Files

- File List

exceptions.h
1 #ifndef SAUCE_EXCEPTIONS_H_
2 #define SAUCE_EXCEPTIONS_H_
3
4 #include <string>
5 #include <stdexcept>
6
7 namespace sauce {
8
12 class Exception: public std::runtime_error {
13 public:
14 Exception(std::string message):
15 std::runtime_error(message) {}
16 };
17
21 class UnboundException: public Exception {
22 public:
23 UnboundException(std::string const name):
24 Exception("Request for unbound interface " + name + ".") {}
25 };
26
30 template<typename Dependency>
31 class UnboundExceptionFor: public UnboundException {
32 public:
33 UnboundExceptionFor(std::string const name): UnboundException(name) {}
34 };
35
39 class PartialBindingException: public Exception {
40 public:
41 PartialBindingException():
42 Exception("Binding is incomplete.") {}
43 };
44
48 template<typename Dependency>
49 class PartialBindingExceptionFor: public PartialBindingException {
50 public:
51 PartialBindingExceptionFor(): PartialBindingException() {}
52 };
53
57 class CircularDependencyException: public Exception {
58 public:
59 CircularDependencyException():
60 Exception("Request for unbound interface.") {}
61 };
62
66 template<typename Dependency>
67 class CircularDependencyExceptionFor: public CircularDependencyException {
68 public:
69 CircularDependencyExceptionFor(): CircularDependencyException() {}
70 };
71
75 class OutOfScopeException: public Exception {
76 public:
77 OutOfScopeException():
78 Exception("Out of dependency scope.") {}
79 };
80
84 template<typename Scope>
85 class OutOfScopeExceptionFor: public OutOfScopeException {
86 public:
87 OutOfScopeExceptionFor(): OutOfScopeException() {}
88 };
89
93 class AlreadyInScopeException: public Exception {
94 public:
95 AlreadyInScopeException():
96 Exception("Already in scope.") {}
97 };
98
102 template<typename Scope>
103 class AlreadyInScopeExceptionFor: public AlreadyInScopeException {
104 public:
105 AlreadyInScopeExceptionFor(): AlreadyInScopeException() {}
106 };
107
111 class ExitingSingletonScopeException: public Exception {
112 public:
113 ExitingSingletonScopeException():
114 Exception("Can't exit SingletonScope") {}
115 };
116
117 }
118
119 #endif // SAUCE_EXCEPTIONS_H_
sauce::PartialBindingException
Thrown when a binding hasn't been completely specified.
Definition: exceptions.h:39
sauce::PartialBindingExceptionFor
Thrown when a binding hasn't been completely specified for the given interface.
Definition: exceptions.h:49
sauce::AlreadyInScopeExceptionFor
Thrown when re-entering the given scope, which is already open.
Definition: exceptions.h:103
sauce::OutOfScopeExceptionFor
Thrown when a provision is requested outside of its given, bound scope.
Definition: exceptions.h:85
sauce::CircularDependencyException
Thrown when a dependency cycle is found.
Definition: exceptions.h:57
sauce::OutOfScopeException
Thrown when a provision is requested outside of its bound scope.
Definition: exceptions.h:75
sauce::CircularDependencyExceptionFor
Thrown when a dependency cycle is found for the given interface.
Definition: exceptions.h:67
sauce
Definition: binder.h:21
sauce::AlreadyInScopeException
Thrown when re-entering a scope that is already open.
Definition: exceptions.h:93
sauce::ExitingSingletonScopeException
Thrown when exiting the singleton scope.
Definition: exceptions.h:111
sauce::Exception
Base class for all sauce exceptions.
Definition: exceptions.h:12
sauce::UnboundException
Thrown when a binding cannot be found.
Definition: exceptions.h:21
sauce::UnboundExceptionFor
Thrown when a binding cannot be found for the given interface.
Definition: exceptions.h:31