source: XIOS/trunk/src/visitor.hpp @ 623

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
4namespace xios {
5
6class CBaseVisitor
7{
8public:
9    virtual ~CBaseVisitor() {}
10};
11
12typedef CBaseVisitor CGenericAlgorithm;
13
14template <class T, typename R = void, bool ConstVisitor = false>
15class CVisitor;
16
17template<typename T, typename R>
18class CVisitor<T, R, false>
19{
20public:
21    typedef R ReturnType;
22    typedef T ParamType;
23    virtual ~CVisitor() {}
24    virtual ReturnType operate(ParamType&) = 0;
25};
26
27template<typename T, typename R>
28class CVisitor<T, R, true>
29{
30public:
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.