Sauce-0.10.1
A C++ Dependency Injection Framework
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>
32 public:
33  UnboundExceptionFor(std::string const name): UnboundException(name) {}
34 };
35 
40 public:
42  Exception("Binding is incomplete.") {}
43 };
44 
48 template<typename Dependency>
50 public:
52 };
53 
58 public:
60  Exception("Request for unbound interface.") {}
61 };
62 
66 template<typename Dependency>
68 public:
70 };
71 
76 public:
78  Exception("Out of dependency scope.") {}
79 };
80 
84 template<typename Scope>
86 public:
88 };
89 
94 public:
96  Exception("Already in scope.") {}
97 };
98 
102 template<typename Scope>
104 public:
106 };
107 
112 public:
114  Exception("Can't exit SingletonScope") {}
115 };
116 
117 }
118 
119 #endif // SAUCE_EXCEPTIONS_H_
Thrown when a binding hasn't been completely specified.
Definition: exceptions.h:39
Thrown when a binding hasn't been completely specified for the given interface.
Definition: exceptions.h:49
Thrown when re-entering the given scope, which is already open.
Definition: exceptions.h:103
Thrown when a provision is requested outside of its given, bound scope.
Definition: exceptions.h:85
Thrown when a dependency cycle is found.
Definition: exceptions.h:57
Thrown when a provision is requested outside of its bound scope.
Definition: exceptions.h:75
Thrown when a dependency cycle is found for the given interface.
Definition: exceptions.h:67
Definition: binder.h:21
Thrown when re-entering a scope that is already open.
Definition: exceptions.h:93
Thrown when exiting the singleton scope.
Definition: exceptions.h:111
Base class for all sauce exceptions.
Definition: exceptions.h:12
Thrown when a binding cannot be found.
Definition: exceptions.h:21
Thrown when a binding cannot be found for the given interface.
Definition: exceptions.h:31