Last change
on this file since 2380 was
642,
checked in by rlacroix, 9 years ago
|
Use the filter infrastructure to handle the expressions
Parse the expressions to get a new tree representation that can be converted to a filter graph based on new arithmetic filters.
Temporal operations are still unsupported.
|
File size:
1.2 KB
|
Line | |
---|
1 | #ifndef __XIOS_CUnaryArithmeticFilter__ |
---|
2 | #define __XIOS_CUnaryArithmeticFilter__ |
---|
3 | |
---|
4 | #include "filter.hpp" |
---|
5 | #include <string> |
---|
6 | #include "operator_expr.hpp" |
---|
7 | |
---|
8 | namespace xios |
---|
9 | { |
---|
10 | /*! |
---|
11 | * A generic unary arithmetic filter wrapping any type of unary operator |
---|
12 | * which can be applied on fields. |
---|
13 | */ |
---|
14 | class CUnaryArithmeticFilter : public CFilter, public IFilterEngine |
---|
15 | { |
---|
16 | public: |
---|
17 | /*! |
---|
18 | * Constructs an unary arithmetic filter wrapping the specified operator. |
---|
19 | * |
---|
20 | * \param gc the associated garbage collector |
---|
21 | * \param op the string identifing the unary operator |
---|
22 | */ |
---|
23 | CUnaryArithmeticFilter(CGarbageCollector& gc, const std::string& op); |
---|
24 | |
---|
25 | protected: |
---|
26 | COperatorExpr::functionField op; //!< The unary operator attached to the unary arithmeric filter |
---|
27 | |
---|
28 | |
---|
29 | /*! |
---|
30 | * Applies the unary operator to the input data and returns the result. |
---|
31 | * |
---|
32 | * \param data a vector of packets corresponding to each slot (one in this case) |
---|
33 | * \return the result of the unary operation |
---|
34 | */ |
---|
35 | CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data); |
---|
36 | }; // class CUnaryArithmeticFilter |
---|
37 | } // namespace xios |
---|
38 | |
---|
39 | #endif //__XIOS_CUnaryArithmeticFilter__ |
---|
Note: See
TracBrowser
for help on using the repository browser.