Last change
on this file since 623 was
619,
checked in by mhnguyen, 9 years ago
|
Implementing the first prototype of filter
+) Create new class filter
+) Implement class for specific algorithm
+) Implement inversing algorithm
Test
+) On Curie
+) Grid with one axis: passed
|
File size:
704 bytes
|
Line | |
---|
1 | #ifndef __XIOS_VISITOR_HPP__ |
---|
2 | #define __XIOS_VISITOR_HPP__ |
---|
3 | |
---|
4 | namespace xios { |
---|
5 | |
---|
6 | class CBaseVisitor |
---|
7 | { |
---|
8 | public: |
---|
9 | virtual ~CBaseVisitor() {} |
---|
10 | }; |
---|
11 | |
---|
12 | typedef CBaseVisitor CGenericAlgorithm; |
---|
13 | |
---|
14 | template <class T, typename R = void, bool ConstVisitor = false> |
---|
15 | class CVisitor; |
---|
16 | |
---|
17 | template<typename T, typename R> |
---|
18 | class CVisitor<T, R, false> |
---|
19 | { |
---|
20 | public: |
---|
21 | typedef R ReturnType; |
---|
22 | typedef T ParamType; |
---|
23 | virtual ~CVisitor() {} |
---|
24 | virtual ReturnType operate(ParamType&) = 0; |
---|
25 | }; |
---|
26 | |
---|
27 | template<typename T, typename R> |
---|
28 | class CVisitor<T, R, true> |
---|
29 | { |
---|
30 | public: |
---|
31 | typedef R ReturnType; |
---|
32 | typedef const T ParamType; |
---|
33 | virtual ~CVisitor() {} |
---|
34 | virtual ReturnType operate(ParamType&) = 0; |
---|
35 | }; |
---|
36 | |
---|
37 | } |
---|
38 | #endif // __XIOS_VISITOR_HPP__ |
---|
Note: See
TracBrowser
for help on using the repository browser.