1 #include "resolver.h"
2 #include "sample_classes.h"
3
4 using namespace dependency;
5
6
7
8 A* create(Zone& zone){
9 return new A();
10 }
11
12 B * make(Zone& zone){
13 return new B();
14 }
15
16 void destroy(A* a){
17 delete a;
18 }
19
20 C* makeC(Zone& zone){
21 return new C(supply<A>::fetch(zone));
22 }
23
24 void dropC(C* c){
25 delete(c);
26 }
27
28 void
29 register_all_bindings(){
30 supply<A>::configure();
31 supply<A,1>::configure(destroy);
32 supply<B>::configure(make);
33 supply<B,1>::configure();
34 supply<C>::configure(makeC,dropC);
35
36 }
syntax highlighted by Code2HTML, v. 0.9.1