| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
extends.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_EXTENDS_H
2 #define GAUDIKERNEL_EXTENDS_H
3
4 #include "GaudiKernel/IInterface.h"
5
9 template <typename BASE, typename I1>
10 struct GAUDI_API extends1: public BASE, virtual public extend_interfaces1<I1> {
12 typedef extends1 base_class;
14 typedef extend_interfaces1<I1> extend_interfaces_base;
15 #ifndef __GCCXML__
16
17 typedef typename extend_interfaces_base::ext_iids interfaces;
18 #endif
19
21 template <typename A1, typename A2, typename A3> extends1(A1 a1, A2 a2, A3 a3): BASE(a1,a2,a3){}
23 template <typename A1, typename A2> extends1(A1 a1, A2 a2): BASE(a1, a2){}
25 template <typename A1> extends1(A1 a1): BASE(a1){}
27 extends1(): BASE(){}
28
30 virtual void *i_cast(const InterfaceID &tid) const {
31 void *ptr = 0;
32 #ifndef __GCCXML__
33 interfaceMatch<base_class> matcher(this,tid,ptr);
34 mpl::for_each<interfaces>(matcher);
35 #endif
36 if (!ptr) {
37 ptr = BASE::i_cast(tid);
38 }
39 return ptr;
40 }
41
43 virtual StatusCode queryInterface(const InterfaceID &ti, void** pp){
44 if (!pp) return StatusCode::FAILURE;
45 *pp = 0;
46 #ifndef __GCCXML__
47 interfaceMatch<base_class> matcher(this,ti,*pp);
48 mpl::for_each<interfaces>(matcher);
49 if (!*pp) { // cast failed, try the base class
50 return BASE::queryInterface(ti,pp);
51 }
52 this->addRef();
53 #endif
54 return StatusCode::SUCCESS;
55 }
56
58 virtual std::vector<std::string> getInterfaceNames() const {
59 std::vector<std::string> v = BASE::getInterfaceNames(); // start from the base
60 #ifndef __GCCXML__
61 AppendInterfaceName appender(v);
62 mpl::for_each<interfaces>(appender);
63 #endif
64 return v;
65 }
66
68 virtual ~extends1() {}
69 };
70
74 template <typename BASE, typename I1, typename I2>
75 struct GAUDI_API extends2: public BASE, virtual public extend_interfaces2<I1,I2> {
77 typedef extends2 base_class;
79 typedef extend_interfaces2<I1,I2> extend_interfaces_base;
80 #ifndef __GCCXML__
81
82 typedef typename extend_interfaces_base::ext_iids interfaces;
83 #endif
84
86 template <typename A1, typename A2, typename A3> extends2(A1 a1, A2 a2, A3 a3): BASE(a1,a2,a3){}
88 template <typename A1, typename A2> extends2(A1 a1, A2 a2): BASE(a1, a2){}
90 template <typename A1> extends2(A1 a1): BASE(a1){}
92 extends2(): BASE(){}
93
95 virtual void *i_cast(const InterfaceID &tid) const {
96 void *ptr = 0;
97 #ifndef __GCCXML__
98 interfaceMatch<base_class> matcher(this,tid,ptr);
99 mpl::for_each<interfaces>(matcher);
100 #endif
101 if (!ptr) {
102 ptr = BASE::i_cast(tid);
103 }
104 return ptr;
105 }
106
108 virtual StatusCode queryInterface(const InterfaceID &ti, void** pp){
109 if (!pp) return StatusCode::FAILURE;
110 *pp = 0;
111 #ifndef __GCCXML__
112 interfaceMatch<base_class> matcher(this,ti,*pp);
113 mpl::for_each<interfaces>(matcher);
114 if (!*pp) { // cast failed, try the base class
115 return BASE::queryInterface(ti,pp);
116 }
117 this->addRef();
118 #endif
119 return StatusCode::SUCCESS;
120 }
121
123 virtual std::vector<std::string> getInterfaceNames() const {
124 std::vector<std::string> v = BASE::getInterfaceNames(); // start from the base
125 #ifndef __GCCXML__
126 AppendInterfaceName appender(v);
127 mpl::for_each<interfaces>(appender);
128 #endif
129 return v;
130 }
131
133 virtual ~extends2() {}
134 };
135
139 template <typename BASE, typename I1, typename I2, typename I3>
140 struct GAUDI_API extends3: public BASE, virtual public extend_interfaces3<I1,I2,I3> {
142 typedef extends3 base_class;
144 typedef extend_interfaces3<I1,I2,I3> extend_interfaces_base;
145 #ifndef __GCCXML__
146
147 typedef typename extend_interfaces_base::ext_iids interfaces;
148 #endif
149
151 template <typename A1, typename A2, typename A3> extends3(A1 a1, A2 a2, A3 a3): BASE(a1,a2,a3){}
153 template <typename A1, typename A2> extends3(A1 a1, A2 a2): BASE(a1, a2){}
155 template <typename A1> extends3(A1 a1): BASE(a1){}
157 extends3(): BASE(){}
158
160 virtual void *i_cast(const InterfaceID &tid) const {
161 void *ptr = 0;
162 #ifndef __GCCXML__
163 interfaceMatch<base_class> matcher(this,tid,ptr);
164 mpl::for_each<interfaces>(matcher);
165 #endif
166 if (!ptr) {
167 ptr = BASE::i_cast(tid);
168 }
169 return ptr;
170 }
171
173 virtual StatusCode queryInterface(const InterfaceID &ti, void** pp){
174 if (!pp) return StatusCode::FAILURE;
175 *pp = 0;
176 #ifndef __GCCXML__
177 interfaceMatch<base_class> matcher(this,ti,*pp);
178 mpl::for_each<interfaces>(matcher);
179 if (!*pp) { // cast failed, try the base class
180 return BASE::queryInterface(ti,pp);
181 }
182 this->addRef();
183 #endif
184 return StatusCode::SUCCESS;
185 }
186
188 virtual std::vector<std::string> getInterfaceNames() const {
189 std::vector<std::string> v = BASE::getInterfaceNames(); // start from the base
190 #ifndef __GCCXML__
191 AppendInterfaceName appender(v);
192 mpl::for_each<interfaces>(appender);
193 #endif
194 return v;
195 }
196
198 virtual ~extends3() {}
199 };
200
201 #endif /* GAUDIKERNEL_EXTENDS_H */